From 815a2aff57735ac96896eca21da4e9ee41bb63ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 9 May 2024 18:12:07 +0200 Subject: [PATCH] fix: Avoid triggering file list requests during handover to desktop client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/mixins/openLocal.js | 11 +++++++---- src/view/Office.vue | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mixins/openLocal.js b/src/mixins/openLocal.js index 87c1670cc2..19df2baaca 100644 --- a/src/mixins/openLocal.js +++ b/src/mixins/openLocal.js @@ -95,8 +95,6 @@ export default { openLocally() { if (this.openingLocally) { - this.openingLocally = false - axios.post( generateOcsUrl('apps/files/api/v1/openlocaleditor'), { path: this.filename }, @@ -106,8 +104,13 @@ export default { + encodePath(this.filename) + '?token=' + result.data.ocs.data.token - this.showOpenLocalFinished(url, window.top) - this.close() + this.showOpenLocalFinished() + // Firefox may cancel requests that the files app could send when updating the file meta data + // so we need to wait a bit before closing the viewer + setTimeout(() => { + this.openingLocally = false + this.close() + }, 1000) window.open(url, '_self') }) } diff --git a/src/view/Office.vue b/src/view/Office.vue index 386e5d3e34..dc360cb04a 100644 --- a/src/view/Office.vue +++ b/src/view/Office.vue @@ -469,7 +469,7 @@ export default { this.buttonClicked(args) break case 'Doc_ModifiedStatus': - if (args.Modified !== this.modified) { + if (args.Modified !== this.modified && !this.openingLocally) { FilesAppIntegration.updateFileInfo(undefined, Date.now()) } this.modified = args.Modified