diff --git a/packages/nc-gui/components/smartsheet/Gallery.vue b/packages/nc-gui/components/smartsheet/Gallery.vue index 0128997248..ed32e305c0 100644 --- a/packages/nc-gui/components/smartsheet/Gallery.vue +++ b/packages/nc-gui/components/smartsheet/Gallery.vue @@ -168,6 +168,22 @@ watch(view, async (nextView) => { await loadGalleryData() } }) + +const { appInfo } = useGlobal() + +const getImgSrc = (item: Record) => { + if (item.data) { + return item.data + } else if (item.path) { + return `${appInfo.value.ncSiteUrl}/${item.path}` + } + return item.url +} + +const showFallback = (evt: any, item: Record) => { + evt.onerror = null + evt.target.src = item.url +}