diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-19 15:17:41 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-19 15:17:41 +0900 |
| commit | bdc72e5817782316bb2c56ab362b4aa237236bef (patch) | |
| tree | 209e6fca274123ea93dc38bce5e9a96bef15a974 /packages/frontend/src/components | |
| parent | 🎨 (diff) | |
| download | misskey-bdc72e5817782316bb2c56ab362b4aa237236bef.tar.gz misskey-bdc72e5817782316bb2c56ab362b4aa237236bef.tar.bz2 misskey-bdc72e5817782316bb2c56ab362b4aa237236bef.zip | |
clean up
Diffstat (limited to 'packages/frontend/src/components')
4 files changed, 11 insertions, 12 deletions
diff --git a/packages/frontend/src/components/MkPageWindow.vue b/packages/frontend/src/components/MkPageWindow.vue index 8a1a9c58d2..a6049b4d91 100644 --- a/packages/frontend/src/components/MkPageWindow.vue +++ b/packages/frontend/src/components/MkPageWindow.vue @@ -60,9 +60,8 @@ const windowRouter = routerFactory(props.initialPath); const pageMetadata = ref<null | PageMetadata>(null); const windowEl = shallowRef<InstanceType<typeof MkWindow>>(); -const history = ref<{ path: string; key: string; }[]>([{ +const history = ref<{ path: string; }[]>([{ path: windowRouter.getCurrentPath(), - key: windowRouter.getCurrentKey(), }]); const buttonsLeft = computed(() => { const buttons: Record<string, unknown>[] = []; @@ -100,12 +99,12 @@ function getSearchMarker(path: string) { const searchMarkerId = ref<string | null>(getSearchMarker(props.initialPath)); windowRouter.addListener('push', ctx => { - history.value.push({ path: ctx.path, key: ctx.key }); + history.value.push({ path: ctx.path }); }); windowRouter.addListener('replace', ctx => { history.value.pop(); - history.value.push({ path: ctx.path, key: ctx.key }); + history.value.push({ path: ctx.path }); }); windowRouter.addListener('change', ctx => { @@ -155,7 +154,7 @@ const contextmenu = computed(() => ([{ function back() { history.value.pop(); - windowRouter.replace(history.value.at(-1)!.path, history.value.at(-1)!.key); + windowRouter.replace(history.value.at(-1)!.path); } function reload() { diff --git a/packages/frontend/src/components/global/NestedRouterView.vue b/packages/frontend/src/components/global/NestedRouterView.vue index eb7192d8e0..40ee21c674 100644 --- a/packages/frontend/src/components/global/NestedRouterView.vue +++ b/packages/frontend/src/components/global/NestedRouterView.vue @@ -47,14 +47,14 @@ function resolveNested(current: Resolved, d = 0): Resolved | null { const current = resolveNested(router.current)!; const currentPageComponent = shallowRef('component' in current.route ? current.route.component : MkLoadingPage); const currentPageProps = ref(current.props); -const key = ref(router.getCurrentKey() + JSON.stringify(Object.fromEntries(current.props))); +const key = ref(router.getCurrentPath()); -function onChange({ resolved, key: newKey }) { +function onChange({ resolved }) { const current = resolveNested(resolved); if (current == null || 'redirect' in current.route) return; currentPageComponent.value = current.route.component; currentPageProps.value = current.props; - key.value = newKey + JSON.stringify(Object.fromEntries(current.props)); + key.value = router.getCurrentPath(); } router.addListener('change', onChange); diff --git a/packages/frontend/src/components/global/RouterView.vue b/packages/frontend/src/components/global/RouterView.vue index b01e355c5e..2f1ee6734f 100644 --- a/packages/frontend/src/components/global/RouterView.vue +++ b/packages/frontend/src/components/global/RouterView.vue @@ -44,13 +44,13 @@ provide(DI.routerCurrentDepth, currentDepth + 1); const current = router.current!; const currentPageComponent = shallowRef('component' in current.route ? current.route.component : MkLoadingPage); const currentPageProps = ref(current.props); -const key = ref(router.getCurrentKey() + JSON.stringify(Object.fromEntries(current.props))); +const key = ref(router.getCurrentPath()); -function onChange({ resolved, key: newKey }) { +function onChange({ resolved }) { if (resolved == null || 'redirect' in resolved.route) return; currentPageComponent.value = resolved.route.component; currentPageProps.value = resolved.props; - key.value = newKey + JSON.stringify(Object.fromEntries(resolved.props)); + key.value = router.getCurrentPath(); nextTick(() => { // ページ遷移完了後に再びキャッシュを有効化 diff --git a/packages/frontend/src/components/global/StackingRouterView.vue b/packages/frontend/src/components/global/StackingRouterView.vue index d1ca655dee..8f5e6663d8 100644 --- a/packages/frontend/src/components/global/StackingRouterView.vue +++ b/packages/frontend/src/components/global/StackingRouterView.vue @@ -123,7 +123,7 @@ function mount() { function back() { const prev = tabs.value[tabs.value.length - 2]; tabs.value = [...tabs.value.slice(0, tabs.value.length - 1)]; - router.replace(prev.path, prev.key); + router.replace(prev.path); } router.addListener('replace', onReplace); |