From 1e0b65a0a4556810ad4a7acac764a57a7daf8cf0 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 31 Jan 2020 07:10:34 +0100 Subject: viewer: minor code cleaning --- viewer/src/store/galleryStore.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'viewer/src/store') 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 { } get currentItemPath(): Gallery.Item[] { - const galleryItemsRoot = this.galleryItemsRoot; - if (galleryItemsRoot) - return GalleryStore.searchCurrentItemPath(galleryItemsRoot, this.currentPath); + const root = this.galleryItemsRoot; + if (root) + return GalleryStore.searchCurrentItemPath(root, this.currentPath); return []; } get currentItem(): Gallery.Item | null { - const currentItemPath = this.currentItemPath; - return currentItemPath.length > 0 ? currentItemPath[currentItemPath.length - 1] : null; + const path = this.currentItemPath; + return path.length > 0 ? path[path.length - 1] : null; } // --- @@ -69,9 +69,9 @@ export default class GalleryStore extends VuexModule { // Indexes the gallery @action async indexTags() { + const root = this.galleryItemsRoot; let index = {}; - if (this.galleryItemsRoot) - GalleryStore.pushTagsForItem(index, this.galleryItemsRoot); + if (root) GalleryStore.pushTagsForItem(index, root); console.log("Index: ", index); this.setTags(index); } -- cgit v1.2.3