fix: gallery without sort
This commit is contained in:
parent
e20b4bff38
commit
a60fe311d6
1 changed files with 4 additions and 5 deletions
|
@ -35,7 +35,7 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (resort && changed) sortAttributes();
|
if (resort && changed) sortEntities();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Labelling
|
// Labelling
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
labelListing = query(`(matches (in ${addressesString}) "LBL" ? )`).result;
|
labelListing = query(`(matches (in ${addressesString}) "LBL" ? )`).result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sortAttributes() {
|
function sortEntities() {
|
||||||
if (!sort) return;
|
if (!sort) return;
|
||||||
|
|
||||||
sortedEntities = deduplicatedEntities.concat();
|
sortedEntities = deduplicatedEntities.concat();
|
||||||
|
@ -80,14 +80,13 @@
|
||||||
deduplicatedEntities.forEach((address) => {
|
deduplicatedEntities.forEach((address) => {
|
||||||
addSortKeys(address, $labelListing.getObject(address).identify());
|
addSortKeys(address, $labelListing.getObject(address).identify());
|
||||||
});
|
});
|
||||||
sortAttributes();
|
sortEntities();
|
||||||
resort = true;
|
resort = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sort) {
|
if (!sort) {
|
||||||
// Since `sortAttributes` also fills `sortedEntities`, we need to run at least once even if we aren't sorting.
|
sortedEntities = entities;
|
||||||
sortAttributes();
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue