Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Temporary Workaround for double clicking item bug
This is a temporary workaround for the bug that occurs when you double click an item that opens in the viewer.  It works for the Viewer for Images, Videos, and PDFs for sure.  I didn't test audio, but it probably works for it as well.

The main cause of the issue is that when a file is double clicked, the file is opened twice.  However, something weird occurs when this happens.  openFile() is only called once, while close() and cleanup() are immediately called.  What I'm guessing happens is that the original file loads, and is closed somehow, followed by the second file opening.  I'm not sure which of those files calls openFile() and which doesn't.  One result of this though is that when the second file is closed, close() is called, but cleanup() is not.  This patch ensures that it is called, which resolves the issue.

There are still some cases where the double clicking can cause the black background of the viewer to not appear (to get this to happen, you have to double click, but put some spaces between the clicks that are a part of the double click, it's difficult to get the timing right, so try it a few times).  But this at least solves the one issue.
  • Loading branch information
MichaelEPope authored Apr 15, 2022
commit 0e78afae6c18184aa9774f29f306a8af532a48dd
3 changes: 3 additions & 0 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ export default {
if (OCA?.Files?.Sidebar) {
OCA.Files.Sidebar.setFullScreenMode(false)
}

//a temporary workaround to deal with a bug that occurs when double clicking on an item in NextCloud.
this.cleanup();
},

cleanup() {
Expand Down