Skip to content

Commit

Permalink
Merge pull request #3688 from nextcloud/backport/3685/stable29
Browse files Browse the repository at this point in the history
[stable29] fix: Avoid triggering file list requests during handover to desktop client
  • Loading branch information
juliushaertl committed May 9, 2024
2 parents bff7592 + 815a2af commit cd14e99
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 @@ -95,8 +95,6 @@ export default {

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

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

0 comments on commit cd14e99

Please sign in to comment.