From f20c79c427374a15a00dbe03b8a95bdc04c5cf36 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Tue, 29 Oct 2024 15:33:04 +0100 Subject: [PATCH] fix: clear ancestor data in app wrapper This fixes an issue where the right sidebar would display wrong shares when being inside a space and opening a file from another space (e.g. via the search results). --- changelog/unreleased/bugfix-sidebar-showing-wrong-shares | 6 ++++++ .../web-pkg/src/components/AppTemplates/AppWrapper.vue | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 changelog/unreleased/bugfix-sidebar-showing-wrong-shares diff --git a/changelog/unreleased/bugfix-sidebar-showing-wrong-shares b/changelog/unreleased/bugfix-sidebar-showing-wrong-shares new file mode 100644 index 00000000000..afea716b585 --- /dev/null +++ b/changelog/unreleased/bugfix-sidebar-showing-wrong-shares @@ -0,0 +1,6 @@ +Bugfix: Sidebar showing wrong shares + +We've fixed a bug where the right sidebar would display wrong shares when being inside a space and opening a file from another space (e.g. via the search results). + +https://github.com/owncloud/web/pull/11830 +https://github.com/owncloud/web/issues/11787 diff --git a/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue b/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue index 6e2ec28fb58..aff1e40cc86 100644 --- a/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue +++ b/packages/web-pkg/src/components/AppTemplates/AppWrapper.vue @@ -455,6 +455,14 @@ export default defineComponent({ let autosaveIntervalId: ReturnType = null onMounted(() => { + if (resourcesStore.ancestorMetaData?.['/'] && unref(space)) { + const clearAncestorData = resourcesStore.ancestorMetaData['/'].spaceId !== unref(space).id + if (clearAncestorData) { + // clear ancestor data in case the user switched spaces (e.g. by opening a file via search results) + resourcesStore.setAncestorMetaData({}) + } + } + if (!unref(isEditor)) { return }