Skip to content

Commit

Permalink
Default to source if fileid is undefined
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed Jul 13, 2023
1 parent 7789a4e commit df7c70c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions js/viewer-filerobot.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-filerobot.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
:data-handler="handlerId">
<component :is="currentFile.modal"
v-if="!currentFile.failed"
:key="currentFile.fileid"
:key="currentFile | uniqueKey"
ref="content"
:active="true"
:can-swipe="false"
Expand Down Expand Up @@ -115,7 +115,7 @@
<!-- PREVIOUS -->
<component :is="previousFile.modal"
v-if="previousFile && !previousFile.failed"
:key="previousFile.fileid"
:key="previousFile | uniqueKey"
ref="previous-content"
v-bind="previousFile"
:file-list="fileList"
Expand All @@ -128,7 +128,7 @@
<!-- CURRENT -->
<component :is="currentFile.modal"
v-if="!currentFile.failed"
:key="currentFile.fileid"
:key="currentFile | uniqueKey"
ref="content"
v-bind="currentFile"
:active="true"
Expand All @@ -147,7 +147,7 @@
<!-- NEXT -->
<component :is="nextFile.modal"
v-if="nextFile && !nextFile.failed"
:key="nextFile.fileid"
:key="nextFile | uniqueKey"
ref="next-content"
v-bind="nextFile"
:file-list="fileList"
Expand Down Expand Up @@ -212,6 +212,12 @@ export default {
Pencil,
},
filters: {
uniqueKey(file) {
return file.fileid || file.source
},
},
mixins: [isFullscreen, isMobile],
data() {
Expand Down

0 comments on commit df7c70c

Please sign in to comment.