fix: gallery without sort

feat/type-attributes
Tomáš Mládek 2022-12-22 13:15:20 +01:00
parent e20b4bff38
commit a60fe311d6
1 changed files with 4 additions and 5 deletions

View File

@ -35,7 +35,7 @@
}
});
if (resort && changed) sortAttributes();
if (resort && changed) sortEntities();
}
// Labelling
@ -53,7 +53,7 @@
labelListing = query(`(matches (in ${addressesString}) "LBL" ? )`).result;
}
function sortAttributes() {
function sortEntities() {
if (!sort) return;
sortedEntities = deduplicatedEntities.concat();
@ -80,14 +80,13 @@
deduplicatedEntities.forEach((address) => {
addSortKeys(address, $labelListing.getObject(address).identify());
});
sortAttributes();
sortEntities();
resort = true;
}
}
if (!sort) {
// Since `sortAttributes` also fills `sortedEntities`, we need to run at least once even if we aren't sorting.
sortAttributes();
sortedEntities = entities;
}
</script>