From 2766f5f9a491c5f7ebf1eeac1c970daec3656be2 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 25 Feb 2020 16:03:00 +0100 Subject: transverse: combine item tree and gallery-wide properties GitHub: closes #142 --- viewer/src/@types/gallery.d.ts | 7 +++++++ viewer/src/store/galleryStore.ts | 1 + 2 files changed, 8 insertions(+) (limited to 'viewer') diff --git a/viewer/src/@types/gallery.d.ts b/viewer/src/@types/gallery.d.ts index 03d21fc..d7645b6 100644 --- a/viewer/src/@types/gallery.d.ts +++ b/viewer/src/@types/gallery.d.ts @@ -22,6 +22,13 @@ declare namespace Gallery { galleryRoot: string, } + interface GalleryProperties { + // empty for now + } + interface Index { + properties: GalleryProperties, + tree: Item + } interface Other extends Item { properties: OtherProperties, } diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index d2b28dd..cd09996 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts @@ -77,6 +77,7 @@ export default class GalleryStore extends VuexModule { const root = this.config?.galleryRoot ?? ''; return fetch(`${process.env.VUE_APP_DATA_URL}${root}index.json`, { cache: "no-cache" }) .then(response => response.json()) + .then(index => index.tree) .then(this.setGalleryItemsRoot) .then(this.indexTags); } -- cgit v1.2.3