From 7e34d8387891fd4fe63fb2ccf25bf72e97b0ccea Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Tue, 17 Jan 2023 22:15:03 -0800 Subject: [PATCH] image-editor: fix with unified download API --- src/components/viewer/Viewer.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/viewer/Viewer.vue b/src/components/viewer/Viewer.vue index f256835d..3b0c6f6d 100644 --- a/src/components/viewer/Viewer.vue +++ b/src/components/viewer/Viewer.vue @@ -10,7 +10,7 @@ @@ -177,6 +177,7 @@ import NcActionButton from "@nextcloud/vue/dist/Components/NcActionButton"; import axios from "@nextcloud/axios"; import { subscribe, unsubscribe } from "@nextcloud/event-bus"; import { showError } from "@nextcloud/dialogs"; +import { getRootUrl } from "@nextcloud/router"; import { getPreviewUrl } from "../../services/FileUtils"; import { getDownloadLink } from "../../services/DavRequests"; @@ -324,10 +325,11 @@ export default defineComponent({ return utils.getLongDateStr(new Date(date * 1000), false, true); }, - /** Get download link for current photo */ - currentDownloadLink(): string | null { - return this.currentPhoto - ? window.location.origin + getDownloadLink(this.currentPhoto) + /** Get DAV download link for current photo */ + editorDownloadLink(): string | null { + const filename = this.currentPhoto?.filename; + return filename + ? window.location.origin + getRootUrl() + `/remote.php/dav${filename}` : null; },