From 55dea017f7bbd891fa5b1c164c0289cf8ab0ef8b Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Tue, 31 Oct 2023 13:29:38 -0700 Subject: [PATCH] sidebar: fix client injection Signed-off-by: Varun Patil --- src/components/Sidebar.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 6080d3d4..aa64b014 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -60,15 +60,16 @@ export default defineComponent({ }, created() { - if (globalThis.OCA) { - globalThis.OCA.Files ??= {}; + utils.onDOMLoaded(async () => { + if (!globalThis.OCA) globalThis.OCA = {}; + if (!globalThis.OCA.Files) globalThis.OCA.Files = {}; // TODO: remove when we have a proper fileinfo standalone library // original scripts are loaded from // https://github.com/nextcloud/server/blob/5bf3d1bb384da56adbf205752be8f840aac3b0c5/lib/private/legacy/template.php#L120-L122 const filesClient = (globalThis.OC.Files).getClient(); Object.assign(globalThis.OCA.Files, { App: { fileList: { filesClient } } }, globalThis.OCA.Files); - } + }); }, mounted() {