aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/components/TemplatePreview.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src/components/TemplatePreview.vue')
-rw-r--r--apps/files/src/components/TemplatePreview.vue6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files/src/components/TemplatePreview.vue b/apps/files/src/components/TemplatePreview.vue
index 7737ebc030f..57af0bf9b64 100644
--- a/apps/files/src/components/TemplatePreview.vue
+++ b/apps/files/src/components/TemplatePreview.vue
@@ -33,7 +33,7 @@
<script>
import { encodePath } from '@nextcloud/paths'
import { generateUrl } from '@nextcloud/router'
-import { getToken, isPublic } from '../utils/davUtils.ts'
+import { isPublicShare, getSharingToken } from '@nextcloud/sharing/public'
// preview width generation
const previewWidth = 256
@@ -107,8 +107,8 @@ export default {
return this.previewUrl
}
// TODO: find a nicer standard way of doing this?
- if (isPublic()) {
- return generateUrl(`/apps/files_sharing/publicpreview/${getToken()}?fileId=${this.fileid}&file=${encodePath(this.filename)}&x=${previewWidth}&y=${previewWidth}&a=1`)
+ if (isPublicShare()) {
+ return generateUrl(`/apps/files_sharing/publicpreview/${getSharingToken()}?fileId=${this.fileid}&file=${encodePath(this.filename)}&x=${previewWidth}&y=${previewWidth}&a=1`)
}
return generateUrl(`/core/preview?fileId=${this.fileid}&x=${previewWidth}&y=${previewWidth}&a=1`)
},