aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/store/galleryStore.ts
diff options
context:
space:
mode:
authorZero~Informatique2020-02-28 18:50:12 +0100
committerZero~Informatique2020-02-28 18:50:12 +0100
commit7f0b8367a2092c5ffd69e9e46d055cbd605c0e3a (patch)
treec7621a6e00610e1d1d1b2564203908cd119ca99b /viewer/src/store/galleryStore.ts
parentfe699fb16018aa22b121b48a85ef228f4b5c6bfd (diff)
downloadldgallery-7f0b8367a2092c5ffd69e9e46d055cbd605c0e3a.tar.gz
viewer: more minor architectural and performance improvement
Diffstat (limited to 'viewer/src/store/galleryStore.ts')
-rw-r--r--viewer/src/store/galleryStore.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts
index bc43ed2..4a5de0f 100644
--- a/viewer/src/store/galleryStore.ts
+++ b/viewer/src/store/galleryStore.ts
@@ -95,7 +95,15 @@ export default class GalleryStore extends VuexModule {
95 // Indexes the gallery 95 // Indexes the gallery
96 @action async indexTags() { 96 @action async indexTags() {
97 const root = this.galleryIndex?.tree ?? null; 97 const root = this.galleryIndex?.tree ?? null;
98 this.setTagsIndex(IndexFactory.generateTags(root)); 98 const index = IndexFactory.generateTags(root);
99 this.setTagsIndex(index);
100 return index;
99 } 101 }
100 102
103 // Searches for tags
104 @action async search(filters: string[]) {
105 const results = filters.flatMap(filter => IndexFactory.searchTags(this.tagsIndex, filter, true));
106 this.setCurrentSearch(results);
107 return results;
108 }
101} 109}