|
78 | 78 | {{ t('viewer', 'Edit') }} |
79 | 79 | </NcActionButton> |
80 | 80 | <!-- Menu items --> |
81 | | - <NcActionButton v-if="Sidebar && !isSidebarShown" |
| 81 | + <NcActionButton v-if="Sidebar && sidebarOpenFilePath && !isSidebarShown" |
82 | 82 | :close-after-click="true" |
83 | 83 | icon="icon-menu-sidebar" |
84 | 84 | @click="showSidebar"> |
@@ -167,7 +167,7 @@ import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen.js' |
167 | 167 | import isMobile from '@nextcloud/vue/dist/Mixins/isMobile' |
168 | 168 |
|
169 | 169 | import { extractFilePaths, sortCompare } from '../utils/fileUtils.js' |
170 | | -import { getRootPath } from '../utils/davUtils.js' |
| 170 | +import { getRootPath, getUserRoot } from '../utils/davUtils.js' |
171 | 171 | import canDownload from '../utils/canDownload.js' |
172 | 172 | import cancelableRequest from '../utils/CancelableRequest.js' |
173 | 173 | import Error from '../components/Error.vue' |
@@ -290,6 +290,9 @@ export default { |
290 | 290 | sidebarFile() { |
291 | 291 | return this.Sidebar && this.Sidebar.file |
292 | 292 | }, |
| 293 | + sidebarOpenFilePath() { |
| 294 | + return this.currentFile?.davPath?.split(getUserRoot())[1] |
| 295 | + }, |
293 | 296 |
|
294 | 297 | /** |
295 | 298 | * Is the current user allowed to delete the file? |
@@ -906,7 +909,7 @@ export default { |
906 | 909 | // TODO: also hide figure, needs a proper method for it in server Sidebar |
907 | 910 |
|
908 | 911 | if (OCA?.Files?.Sidebar) { |
909 | | - await OCA.Files.Sidebar.open(this.currentFile.filename) |
| 912 | + await OCA.Files.Sidebar.open(this.sidebarOpenFilePath) |
910 | 913 | } |
911 | 914 | }, |
912 | 915 |
|
|
0 commit comments