Skip to content

Commit 6fbd987

Browse files
mejo-nextcloud-command
authored andcommitted
Always check for OCA.Files before using it (Fixes: #1106)
Signed-off-by: Jonas Meurer <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
1 parent 05718f7 commit 6fbd987

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

js/viewer-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/views/Viewer.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default {
326326
this.isLoaded = true
327327
328328
// bind Sidebar if available
329-
if (OCA.Files && OCA.Files.Sidebar) {
329+
if (OCA?.Files?.Sidebar) {
330330
this.Sidebar = OCA.Files.Sidebar.state
331331
}
332332
})
@@ -365,7 +365,7 @@ export default {
365365
this.cancelRequestFile()
366366
this.cancelRequestFolder()
367367
368-
if (OCA.Files.Sidebar) {
368+
if (OCA?.Files?.Sidebar) {
369369
OCA.Files.Sidebar.setFullScreenMode(true)
370370
}
371371
@@ -650,7 +650,7 @@ export default {
650650
// which then triggers cleanup.
651651
OCA.Viewer.close()
652652
653-
if (OCA.Files.Sidebar) {
653+
if (OCA?.Files?.Sidebar) {
654654
OCA.Files.Sidebar.setFullScreenMode(false)
655655
}
656656
},
@@ -739,7 +739,7 @@ export default {
739739
// Open the sidebar sharing tab
740740
// TODO: also hide figure, needs a proper method for it in server Sidebar
741741
742-
if (OCA.Files.Sidebar) {
742+
if (OCA?.Files?.Sidebar) {
743743
await OCA.Files.Sidebar.open(this.currentFile.filename)
744744
}
745745
},

0 commit comments

Comments
 (0)