Skip to content

Commit

Permalink
refactor: separate media error from fetch error
Browse files Browse the repository at this point in the history
so that media error can be cleared when switching page where a different
media resource would be loaded
  • Loading branch information
rwd committed Dec 12, 2024
1 parent 5226c61 commit 3f6666c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/portal/src/components/item/ItemMediaPresentation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/>
</template>
<IIIFErrorMessage
v-if="$fetchState.error"
v-if="$fetchState.error || mediaError"
:provider-url="providerUrl"
/>
<MediaImageViewer
Expand Down Expand Up @@ -220,6 +220,7 @@
data() {
return {
fullscreen: false,
mediaError: null,
mockFullscreenClass: false,
showPages: true,
showSidebar: false,
Expand Down Expand Up @@ -301,6 +302,7 @@
watch: {
'$route.query.page'() {
this.mediaError = null;
this.setPage(this.$route.query.page);
},
Expand All @@ -312,7 +314,7 @@
methods: {
handleImageError(error) {
this.$fetchState.error = error;
this.mediaError = error;
this.handleError(error);
},
Expand Down

0 comments on commit 3f6666c

Please sign in to comment.