diff options
author | Zero~Informatique | 2020-01-31 07:10:34 +0100 |
---|---|---|
committer | Zero~Informatique | 2020-01-31 07:10:34 +0100 |
commit | 1e0b65a0a4556810ad4a7acac764a57a7daf8cf0 (patch) | |
tree | 9468bedb7b07166505e0a82eadd68d67c1bb0262 /viewer | |
parent | 914aa63cb65f869be9b1707c160847be16f79a68 (diff) | |
download | ldgallery-1e0b65a0a4556810ad4a7acac764a57a7daf8cf0.tar.gz |
viewer: minor code cleaning
Diffstat (limited to 'viewer')
-rw-r--r-- | viewer/src/plugins/router.ts | 8 | ||||
-rw-r--r-- | viewer/src/store/galleryStore.ts | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/viewer/src/plugins/router.ts b/viewer/src/plugins/router.ts index 0f3d2c7..8b4a8dc 100644 --- a/viewer/src/plugins/router.ts +++ b/viewer/src/plugins/router.ts | |||
@@ -19,17 +19,17 @@ | |||
19 | 19 | ||
20 | import Vue from "vue"; | 20 | import Vue from "vue"; |
21 | import VueRouter from "vue-router"; | 21 | import VueRouter from "vue-router"; |
22 | import Gallery from "@/views/MainGallery.vue"; | 22 | import MainGallery from "@/views/MainGallery.vue"; |
23 | 23 | ||
24 | Vue.use(VueRouter); | 24 | Vue.use(VueRouter); |
25 | 25 | ||
26 | // async way : component: () => import(/* webpackChunkName: "Gallery" */ "@/views/Gallery.vue"), | 26 | // async way : component: () => import(/* webpackChunkName: "MainGallery" */ "@/views/MainGallery.vue"), |
27 | 27 | ||
28 | const routes = [ | 28 | const routes = [ |
29 | { | 29 | { |
30 | path: "*", | 30 | path: "*", |
31 | name: "Gallery", | 31 | name: "MainGallery", |
32 | component: Gallery, | 32 | component: MainGallery, |
33 | props: true | 33 | props: true |
34 | }, | 34 | }, |
35 | ]; | 35 | ]; |
diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index b2ff74e..1c95fe7 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts | |||
@@ -46,15 +46,15 @@ export default class GalleryStore extends VuexModule { | |||
46 | } | 46 | } |
47 | 47 | ||
48 | get currentItemPath(): Gallery.Item[] { | 48 | get currentItemPath(): Gallery.Item[] { |
49 | const galleryItemsRoot = this.galleryItemsRoot; | 49 | const root = this.galleryItemsRoot; |
50 | if (galleryItemsRoot) | 50 | if (root) |
51 | return GalleryStore.searchCurrentItemPath(galleryItemsRoot, this.currentPath); | 51 | return GalleryStore.searchCurrentItemPath(root, this.currentPath); |
52 | return []; | 52 | return []; |
53 | } | 53 | } |
54 | 54 | ||
55 | get currentItem(): Gallery.Item | null { | 55 | get currentItem(): Gallery.Item | null { |
56 | const currentItemPath = this.currentItemPath; | 56 | const path = this.currentItemPath; |
57 | return currentItemPath.length > 0 ? currentItemPath[currentItemPath.length - 1] : null; | 57 | return path.length > 0 ? path[path.length - 1] : null; |
58 | } | 58 | } |
59 | 59 | ||
60 | // --- | 60 | // --- |
@@ -69,9 +69,9 @@ export default class GalleryStore extends VuexModule { | |||
69 | 69 | ||
70 | // Indexes the gallery | 70 | // Indexes the gallery |
71 | @action async indexTags() { | 71 | @action async indexTags() { |
72 | const root = this.galleryItemsRoot; | ||
72 | let index = {}; | 73 | let index = {}; |
73 | if (this.galleryItemsRoot) | 74 | if (root) GalleryStore.pushTagsForItem(index, root); |
74 | GalleryStore.pushTagsForItem(index, this.galleryItemsRoot); | ||
75 | console.log("Index: ", index); | 75 | console.log("Index: ", index); |
76 | this.setTags(index); | 76 | this.setTags(index); |
77 | } | 77 | } |