folder: redact hash on route change

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/merge
Varun Patil 2023-11-09 23:51:58 -08:00
parent 857bcb8773
commit d58c492fac
2 changed files with 15 additions and 8 deletions

View File

@ -58,7 +58,11 @@ export default defineComponent({
} }
path = [...path, this.data.name]; // intentional copy path = [...path, this.data.name]; // intentional copy
return { ...this.$route, params: { path } }; return {
...this.$route,
params: { path },
hash: undefined,
};
}, },
previews(): IPhoto[] { previews(): IPhoto[] {

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="top-matter"> <div class="top-matter">
<NcBreadcrumbs> <NcBreadcrumbs>
<NcBreadcrumb :title="rootFolderName" :to="{ ...$route, params: { path: [] }, hash: undefined }"> <NcBreadcrumb :title="rootFolderName" :to="getRoute([])">
<template #icon> <template #icon>
<template v-if="routeIsPublic"> <template v-if="routeIsPublic">
<ShareIcon :size="20" /> <ShareIcon :size="20" />
@ -12,12 +12,7 @@
</template> </template>
</template> </template>
</NcBreadcrumb> </NcBreadcrumb>
<NcBreadcrumb <NcBreadcrumb v-for="folder in list" :key="folder.idx" :title="folder.text" :to="getRoute(folder.path)" />
v-for="folder in list"
:key="folder.idx"
:title="folder.text"
:to="{ ...$route, params: { path: folder.path }, hash: undefined }"
/>
</NcBreadcrumbs> </NcBreadcrumbs>
<div class="right-actions"> <div class="right-actions">
@ -117,6 +112,14 @@ export default defineComponent({
}, },
}); });
}, },
getRoute(path: string[]) {
return {
...this.$route,
params: { path },
hash: undefined,
};
},
}, },
}); });
</script> </script>