fix: 非ログイン時にクレデンシャルが必要なページに行くとエラーが出る問題を修正 (#10973)

* 非ログイン時にクレデンシャルが必要なページに行くとエラーが出る問題を修正 (misskey-dev/misskey#10922)

* Update CHANGELOG.md

* fix

* Update CHANGELOG.md

* Update CHANGELOG.md
This commit is contained in:
Chocolate Pie
2023-07-08 08:58:35 +09:00
committed by GitHub
parent 8ec96ad1e0
commit bd843863d0
5 changed files with 24 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import { $i, iAmModerator } from '@/account';
import MkLoading from '@/pages/_loading_.vue';
import MkError from '@/pages/_error_.vue';
const page = (loader: AsyncComponentLoader<any>) => defineAsyncComponent({
export const page = (loader: AsyncComponentLoader<any>) => defineAsyncComponent({
loader: loader,
loadingComponent: MkLoading,
errorComponent: MkError,
@@ -505,7 +505,7 @@ export const routes = [{
component: page(() => import('./pages/not-found.vue')),
}];
export const mainRouter = new Router(routes, location.pathname + location.search + location.hash);
export const mainRouter = new Router(routes, location.pathname + location.search + location.hash, !!$i, page(() => import('@/pages/not-found.vue')));
window.history.replaceState({ key: mainRouter.getCurrentKey() }, '', location.href);