From a60fe311d6936f25649c2348ad1875bb54f5b3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Thu, 22 Dec 2022 13:15:20 +0100 Subject: [PATCH] fix: gallery without sort --- webui/src/components/widgets/Gallery.svelte | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/webui/src/components/widgets/Gallery.svelte b/webui/src/components/widgets/Gallery.svelte index 33ea0d5..250bed6 100644 --- a/webui/src/components/widgets/Gallery.svelte +++ b/webui/src/components/widgets/Gallery.svelte @@ -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; }