Skip to content

Commit

Permalink
Merge pull request #3686 from nextcloud/backport/3685/stable27
Browse files Browse the repository at this point in the history
[stable27] fix: Avoid triggering file list requests during handover to desktop client
  • Loading branch information
juliusknorr authored May 9, 2024
2 parents aac6af2 + c0b63f1 commit d49f573
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/mixins/openLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ export default {

openLocally() {
if (this.openingLocally) {
this.openingLocally = false

axios.post(
generateOcsUrl('apps/files/api/v1/openlocaleditor'),
{ path: this.filename },
Expand All @@ -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')
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d49f573

Please sign in to comment.