From 7f0b8367a2092c5ffd69e9e46d055cbd605c0e3a Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 28 Feb 2020 18:50:12 +0100
Subject: viewer: more minor architectural and performance improvement
---
viewer/src/views/GallerySearch.vue | 1 +
viewer/src/views/MainLayout.vue | 2 +-
viewer/src/views/PanelLeft.vue | 6 +-----
3 files changed, 3 insertions(+), 6 deletions(-)
(limited to 'viewer/src/views')
diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index e3369b3..e75a37e 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -39,6 +39,7 @@ export default class GalleryPicture extends Vue {
destroyed() {
this.$uiStore.toggleSearchMode(false);
+ this.$galleryStore.setCurrentSearch([]);
}
items() {
diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue
index 6ab7d9a..53917da 100644
--- a/viewer/src/views/MainLayout.vue
+++ b/viewer/src/views/MainLayout.vue
@@ -27,7 +27,7 @@
-
+
diff --git a/viewer/src/views/PanelLeft.vue b/viewer/src/views/PanelLeft.vue
index 5b3196a..9e9a600 100644
--- a/viewer/src/views/PanelLeft.vue
+++ b/viewer/src/views/PanelLeft.vue
@@ -70,11 +70,7 @@ export default class PanelLeft extends Vue {
@Watch("$route")
restoreSearchFilters(route: Route) {
const query = Object.keys(route.query);
- if (query.length > 0) {
- const tagsIndex = this.$galleryStore.tagsIndex;
- this.searchFilters = Object.keys(route.query).flatMap(filter => IndexFactory.searchTags(tagsIndex, filter, true));
- this.$galleryStore.setCurrentSearch([...this.searchFilters]);
- }
+ if (query.length > 0) this.$galleryStore.search(query).then(search => (this.searchFilters = [...search]));
}
}
--
cgit v1.2.3