Skip to content

Commit

Permalink
fixed small issue with returning the list
Browse files Browse the repository at this point in the history
  • Loading branch information
neurokitti committed Dec 27, 2024
1 parent cbcb5cf commit 842451c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/browser/base/zen-components/ZenWorkspaces.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -566,17 +566,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
emojiScores.push({ "emoji": currentEmoji.emoji, "score": alignmentScore });
}
}

// Sort the emojis by their score in descending order
emojiScores.sort((a, b) => b.Score - a.Score);

// Filter out emojis with a score lower than 10
let filteredEmojiScores = emojiScores;
if (emojiScores.length > 30) {
filteredEmojiScores = emojiScores.filter(score => score.Score >= 10);
}


// Return the emojis in the order of their rank
let filteredEmojiScores = emojiScores;
return filteredEmojiScores.map(score => score.emoji);
}

Expand Down

0 comments on commit 842451c

Please sign in to comment.