Skip to content

Commit ecf7e5f

Browse files
authored
Merge pull request #421 from nextcloud/fix-trying-to-open-the-sidebar-when-not-available
Fix trying to open the sidebar when not available
2 parents 05f77b9 + 50253c6 commit ecf7e5f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

apps/viewer/apps/viewer/src/views/Viewer.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,15 @@ export default {
180180
isEndOfList() {
181181
return this.currentIndex === this.fileList.length - 1
182182
},
183-
// Current opened file in the sidebar if available
183+
/**
184+
* Returns the path to the current opened file in the sidebar.
185+
*
186+
* If the sidebar is available but closed an empty string is returned.
187+
* If the sidebar is not available null is returned.
188+
*
189+
* @returns {string|null} the path to the current opened file in the
190+
* sidebar, if any.
191+
*/
184192
sidebarFile() {
185193
return this.Sidebar && this.Sidebar.file
186194
},
@@ -401,7 +409,7 @@ export default {
401409
* Show sidebar if available and a file is already opened
402410
*/
403411
changeSidebar() {
404-
if (OCA.Files.Sidebar && this.sidebarFile !== '') {
412+
if (this.sidebarFile) {
405413
this.showSidebar()
406414
}
407415
},

0 commit comments

Comments
 (0)