Skip to content

Commit ca02eb7

Browse files
Merge pull request #56514 from nextcloud/backport/56138/stable31
[stable31] fix(files): Do not fail on missing sidebar in files list
2 parents bbeae5c + f506bc1 commit ca02eb7

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

apps/files/src/actions/sidebarAction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ export const action = new FileAction({
4545
async exec(node: Node, view: View, dir: string) {
4646
try {
4747
// If the sidebar is already open for the current file, do nothing
48-
if (window.OCA.Files.Sidebar.file === node.path) {
48+
if (window.OCA.Files?.Sidebar?.file === node.path) {
4949
logger.debug('Sidebar already open for this file', { node })
5050
return null
5151
}
5252
// Open sidebar and set active tab to sharing by default
53-
window.OCA.Files.Sidebar.setActiveTab('sharing')
53+
window.OCA.Files?.Sidebar?.setActiveTab('sharing')
5454

5555
// TODO: migrate Sidebar to use a Node instead
56-
await window.OCA.Files.Sidebar.open(node.path)
56+
await window.OCA.Files?.Sidebar?.open(node.path)
5757

5858
// Silently update current fileid
5959
window.OCP?.Files?.Router?.goToRoute(

dist/files-init.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.

dist/files-init.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.

dist/files-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.

dist/files-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.

dist/files_sharing-init.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.

dist/files_sharing-init.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.

0 commit comments

Comments
 (0)