aboutsummaryrefslogtreecommitdiff
path: root/viewer/src
diff options
context:
space:
mode:
authorZero~Informatique2021-06-26 17:44:03 +0200
committerZero~Informatique2021-06-26 17:44:03 +0200
commit6b125a393d8ce10bfd9273c24ea1615b335abeba (patch)
tree0ea6be38d6e94ba9b72e7ff2d78dba015e053537 /viewer/src
parent7bd88b9d462903ae7753b9ef7a3613ebcd9bad45 (diff)
downloadldgallery-6b125a393d8ce10bfd9273c24ea1615b335abeba.tar.gz
viewer/GalleryNavigation: uniquely identify viewer instances by item
Fixed error "Object is possibly 'null'" in the template
Diffstat (limited to 'viewer/src')
-rw-r--r--viewer/src/views/GalleryNavigation.vue6
1 files changed, 5 insertions, 1 deletions
diff --git a/viewer/src/views/GalleryNavigation.vue b/viewer/src/views/GalleryNavigation.vue
index c53df66..69198f6 100644
--- a/viewer/src/views/GalleryNavigation.vue
+++ b/viewer/src/views/GalleryNavigation.vue
@@ -21,7 +21,7 @@
21 <div> 21 <div>
22 <ld-error v-if="isError" icon="folder-open" :message="$t('gallery.unknown-resource')" /> 22 <ld-error v-if="isError" icon="folder-open" :message="$t('gallery.unknown-resource')" />
23 <gallery-search v-else-if="isSearch" :path="path" /> 23 <gallery-search v-else-if="isSearch" :path="path" />
24 <component :is="componentName" v-else :key="$galleryStore.currentItem.path" :item="$galleryStore.currentItem" /> 24 <component :is="componentName" v-else :key="componentKey" :item="$galleryStore.currentItem" />
25 </div> 25 </div>
26</template> 26</template>
27 27
@@ -66,6 +66,10 @@ export default class GalleryNavigation extends Vue {
66 return this.COMPONENT_BY_TYPE[this.$galleryStore.currentItem?.properties.type ?? ItemType.OTHER]; 66 return this.COMPONENT_BY_TYPE[this.$galleryStore.currentItem?.properties.type ?? ItemType.OTHER];
67 } 67 }
68 68
69 get componentKey() {
70 return this.$galleryStore.currentItem?.path ?? "";
71 }
72
69 @Watch("path") 73 @Watch("path")
70 pathChanged() { 74 pathChanged() {
71 this.$galleryStore.setCurrentPath(this.path); 75 this.$galleryStore.setCurrentPath(this.path);