Sort ideas by vote count
This commit is contained in:
parent
f077bf1f0f
commit
0d4a4d8ef2
@ -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