ordering tags alphabetically

This commit is contained in:
Jack 2020-12-14 18:50:43 +00:00
parent 3a653de592
commit cc064528e4

View file

@ -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;