From c0b63f1b1667e6fbc30024e0a5820cd639c079cf 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 b87ebda9b8..bd8ed7fe1b 100644 --- a/src/mixins/openLocal.js +++ b/src/mixins/openLocal.js @@ -100,8 +100,6 @@ export default { openLocally() { if (this.openingLocally) { - this.openingLocally = false - axios.post( generateOcsUrl('apps/files/api/v1/openlocaleditor'), { path: this.filename }, @@ -111,8 +109,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 62895c18dc..48c48daee5 100644 --- a/src/view/Office.vue +++ b/src/view/Office.vue @@ -446,7 +446,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