mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 05:17:51 +08:00
ordering tags alphabetically
This commit is contained in:
parent
3a653de592
commit
cc064528e4
1 changed files with 9 additions and 0 deletions
|
@ -40,6 +40,15 @@ export async function db_getUserSnapshot() {
|
|||
tag.id = doc.id;
|
||||
snap.tags.push(tag);
|
||||
});
|
||||
snap.tags = snap.tags.sort((a, b) => {
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
} else if (a.name < b.name) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
throw e;
|
||||
|
|
Loading…
Reference in a new issue