aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views/GallerySearch.vue
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src/views/GallerySearch.vue')
-rw-r--r--viewer/src/views/GallerySearch.vue16
1 files changed, 2 insertions, 14 deletions
diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index f4c28b0..4b6dd7f 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -22,22 +22,17 @@
22</template> 22</template>
23 23
24<script lang="ts"> 24<script lang="ts">
25import { Component, Vue, Prop, Watch } from "vue-property-decorator"; 25import { Component, Vue, Prop } from "vue-property-decorator";
26import { Operation } from "@/@types/Operation"; 26import { Operation } from "@/@types/Operation";
27import IndexSearch from "@/services/indexsearch"; 27import IndexSearch from "@/services/indexsearch";
28import IndexFactory from "@/services/indexfactory";
29 28
30@Component 29@Component
31export default class GalleryPicture extends Vue { 30export default class GalleryPicture extends Vue {
32 @Prop(String) readonly path!: string; 31 @Prop(String) readonly path!: string;
33 @Prop(Array) readonly query!: string[];
34
35 currentSearch: Tag.Search[] = [];
36 32
37 mounted() { 33 mounted() {
38 this.$uiStore.fullscreen = false; 34 this.$uiStore.fullscreen = false;
39 this.$uiStore.searchMode = true; 35 this.$uiStore.searchMode = true;
40 this.restoreSearchFilters();
41 } 36 }
42 37
43 destroyed() { 38 destroyed() {
@@ -45,14 +40,7 @@ export default class GalleryPicture extends Vue {
45 } 40 }
46 41
47 items() { 42 items() {
48 return IndexSearch.search(this.currentSearch, this.path); 43 return IndexSearch.search(this.$galleryStore.currentSearch, this.path);
49 }
50
51 @Watch("query")
52 restoreSearchFilters() {
53 const tagsIndex = this.$galleryStore.tagsIndex;
54 this.currentSearch = this.query.flatMap(filter => IndexFactory.searchTags(tagsIndex, filter));
55 this.$uiStore.searchFilters = [...this.currentSearch];
56 } 44 }
57} 45}
58</script> 46</script>