diff options
author | Louis Chemineau <louis@chmn.me> | 2023-11-20 11:28:42 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2023-11-20 18:12:25 +0100 |
commit | 6896724dd4903317f8714e12ba66eb776e81e307 (patch) | |
tree | 042c4f7737e1d5b631459840f23089f34fb40965 /apps/files_versions/src/components | |
parent | 02807a37b0ee9ab920b2575538461ae5aede63bf (diff) | |
download | nextcloud-server-6896724dd4903317f8714e12ba66eb776e81e307.tar.gz nextcloud-server-6896724dd4903317f8714e12ba66eb776e81e307.zip |
Handle error in previews for files versions
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/files_versions/src/components')
-rw-r--r-- | apps/files_versions/src/components/Version.vue | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/files_versions/src/components/Version.vue b/apps/files_versions/src/components/Version.vue index 7376362995a..5f4e7b447ea 100644 --- a/apps/files_versions/src/components/Version.vue +++ b/apps/files_versions/src/components/Version.vue @@ -24,14 +24,15 @@ @click="click"> <template #icon> <div v-if="!(loadPreview || previewLoaded)" class="version__image" /> - <img v-else-if="isCurrent || version.hasPreview" + <img v-else-if="(isCurrent || version.hasPreview) && !previewErrored" :src="version.previewUrl" alt="" decoding="async" fetchpriority="low" loading="lazy" class="version__image" - @load="previewLoaded = true"> + @load="previewLoaded = true" + @error="previewErrored = true"> <div v-else class="version__image"> <ImageOffOutline :size="20" /> @@ -212,6 +213,7 @@ export default { data() { return { previewLoaded: false, + previewErrored: false, showVersionLabelForm: false, formVersionLabelValue: this.version.label, capabilities: loadState('core', 'capabilities', { files: { version_labeling: false, version_deletion: false } }), |