Skip to content

Commit

Permalink
Merge pull request #1555 from nextcloud/backport/1554/stable25
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Feb 24, 2023
2 parents ffc45f3 + c42a283 commit f74302c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
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.

1 change: 1 addition & 0 deletions src/components/ImageEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export default {
if (putUrl !== this.src) {
emit('files:file:created', { fileid: parseInt(response?.headers?.['oc-fileid']?.split('oc')[0]) || null })
} else {
this.$emit('updated')
emit('files:file:updated', { fileid: this.fileid })
}
} catch (error) {
Expand Down
11 changes: 9 additions & 2 deletions src/components/Images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@
:mime="mime"
:src="src"
:fileid="fileid"
@updated="onUpdate"
@close="onClose" />

<img v-else
<img v-else-if="data !== null"
:alt="alt"
:class="{
dragging,
loaded,
zoomed: zoomRatio !== 1
}"
:src="data"
:src="`${data}${cacheBuster}`"
:style="{
marginTop: shiftY + 'px',
marginLeft: shiftX + 'px',
Expand Down Expand Up @@ -81,6 +82,8 @@ export default {
shiftY: 0,
zoomRatio: 1,
fallback: false,
cacheBuster: '',
cacheBusterCounter: 0,
}
},

Expand Down Expand Up @@ -264,6 +267,10 @@ export default {
this.fallback = true
}
},

onUpdate() {
this.cacheBuster = `?buster=${this.cacheBusterCounter++}`
},
},
}
</script>
Expand Down

0 comments on commit f74302c

Please sign in to comment.