Skip to content
Merged
Show file tree
Hide file tree
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
Always check for OCA.Files before using it (Fixes: #1106)
Signed-off-by: Jonas Meurer <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
mejo- authored and nextcloud-command committed Dec 21, 2021
commit 6fbd987efd7b43b8650fa34236e9ebb0b856a05e
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default {
this.isLoaded = true

// bind Sidebar if available
if (OCA.Files && OCA.Files.Sidebar) {
if (OCA?.Files?.Sidebar) {
this.Sidebar = OCA.Files.Sidebar.state
}
})
Expand Down Expand Up @@ -365,7 +365,7 @@ export default {
this.cancelRequestFile()
this.cancelRequestFolder()

if (OCA.Files.Sidebar) {
if (OCA?.Files?.Sidebar) {
OCA.Files.Sidebar.setFullScreenMode(true)
}

Expand Down Expand Up @@ -650,7 +650,7 @@ export default {
// which then triggers cleanup.
OCA.Viewer.close()

if (OCA.Files.Sidebar) {
if (OCA?.Files?.Sidebar) {
OCA.Files.Sidebar.setFullScreenMode(false)
}
},
Expand Down Expand Up @@ -739,7 +739,7 @@ export default {
// Open the sidebar sharing tab
// TODO: also hide figure, needs a proper method for it in server Sidebar

if (OCA.Files.Sidebar) {
if (OCA?.Files?.Sidebar) {
await OCA.Files.Sidebar.open(this.currentFile.filename)
}
},
Expand Down