Skip to content

Commit

Permalink
fix: active share nav item
Browse files Browse the repository at this point in the history
Fixes an issue where the share nav item would be wrongly marked as active after closing a file viewer/editor in the personal space. This happened because the `currentSpace` had been reset as soon as the `useDriveResolver` composable got unmounted. This must not happen in personal or project spaces though.
  • Loading branch information
JammingBen committed Mar 18, 2024
1 parent 96b866f commit 12e7e30
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export const useDriveResolver = (options: DriveResolverOptions = {}): DriveResol

// clean up global state as the watchers aren't triggered anymore when navigating away
onUnmounted(() => {
spacesStore.setCurrentSpace(null)
const driveAliasAndItem = unref(options.driveAliasAndItem)
if (!driveAliasAndItem?.startsWith('personal/') && !driveAliasAndItem?.startsWith('project/')) {
spacesStore.setCurrentSpace(null)
}
})

watch(
Expand Down

0 comments on commit 12e7e30

Please sign in to comment.