Merge pull request #2 from ok2/codex/sort-ideas-by-number-of-votes-desc
Sort ideas by vote count
This commit is contained in:
commit
bede2873ea
@ -801,6 +801,7 @@
|
||||
|
||||
// Render ideas
|
||||
function renderIdeas() {
|
||||
sortIdeasByVotes();
|
||||
if (currentView === 'cards') {
|
||||
renderCardsView();
|
||||
} else {
|
||||
@ -939,6 +940,11 @@
|
||||
}
|
||||
|
||||
// Utility functions
|
||||
function sortIdeasByVotes() {
|
||||
if (!currentTour) return;
|
||||
currentTour.ideas.sort((a, b) => b.voters.length - a.voters.length);
|
||||
}
|
||||
|
||||
function generateUUID() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
const r = Math.random() * 16 | 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user