perf: only show items in gallery once sorted

feat/type-attributes
Tomáš Mládek 2022-12-18 14:08:27 +01:00
parent 881d48ec00
commit 2c41cffce0
1 changed files with 5 additions and 2 deletions

View File

@ -19,7 +19,7 @@
$: style = !thumbnails || clientWidth < 600 ? "list" : "grid";
// Sorting
let sortedEntities = deduplicatedEntities || [];
let sortedEntities = [];
let resort = false;
let sortKeys: { [key: string]: string[] } = {};
@ -85,7 +85,10 @@
}
}
sortAttributes();
if (!sort) {
// Since `sortAttributes` also fills `sortedEntities`, we need to run at least once even if we aren't sorting.
sortAttributes();
}
</script>
<div