dejar index en historial al cargar automaticmaente pagina
This commit is contained in:
parent
178b9f3c28
commit
964bd059c3
1 changed files with 7 additions and 7 deletions
|
@ -20,29 +20,29 @@ export const currentRoute = writable<{
|
|||
}>({ component: ChooseWorld });
|
||||
|
||||
export let router = navaid("/", () =>
|
||||
currentRoute.set({ component: NotFound })
|
||||
currentRoute.set({ component: NotFound }),
|
||||
);
|
||||
router.on(routes.ChooseWorld, () =>
|
||||
currentRoute.set({ component: ChooseWorld })
|
||||
currentRoute.set({ component: ChooseWorld }),
|
||||
);
|
||||
router.on(routes.CreateWorld, () =>
|
||||
currentRoute.set({ component: CreateWorld })
|
||||
currentRoute.set({ component: CreateWorld }),
|
||||
);
|
||||
router.on(routes.ShareWorld, (params) =>
|
||||
currentRoute.set({ component: ShareWorld, params })
|
||||
currentRoute.set({ component: ShareWorld, params }),
|
||||
);
|
||||
router.on(routes.JoinWorld, (params) =>
|
||||
currentRoute.set({ component: JoinWorld, params })
|
||||
currentRoute.set({ component: JoinWorld, params }),
|
||||
);
|
||||
router.on(routes.Page, (params) =>
|
||||
currentRoute.set({ component: Page, params })
|
||||
currentRoute.set({ component: Page, params }),
|
||||
);
|
||||
|
||||
async function setRouteToLastPage() {
|
||||
if (location.pathname === "/") {
|
||||
const lastPage = await lastPageStore.get();
|
||||
if (lastPage) {
|
||||
router.route(inject(routes.Page, lastPage), true);
|
||||
router.route(inject(routes.Page, lastPage));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue