diff --git a/src/accounts/stores.ts b/src/accounts/stores.ts index c44a012..9b66924 100644 --- a/src/accounts/stores.ts +++ b/src/accounts/stores.ts @@ -167,7 +167,7 @@ export async function getOrRegisterApp(site: string, redirectUrl: string) { }); const app = await client.v1.apps.create({ clientName: "TuTu", - website: "https://code.lightstands.xyz/Rubicon/tutu", + website: "https://github.com/thislight/tutu", redirectUris: redirectUrl, scopes: "read write push", }); diff --git a/src/masto/clients.ts b/src/masto/clients.ts index f853fa7..43cd5ec 100644 --- a/src/masto/clients.ts +++ b/src/masto/clients.ts @@ -64,7 +64,7 @@ export function useSessions() { if (sessions().length > 0) return; push( "/accounts/sign-in?back=" + encodeURIComponent(location.pathname), - { replace: "all" }, + { replace: true }, ); }); diff --git a/src/platform/StackedRouter.tsx b/src/platform/StackedRouter.tsx index b20106f..8fde8ee 100644 --- a/src/platform/StackedRouter.tsx +++ b/src/platform/StackedRouter.tsx @@ -36,9 +36,9 @@ export type NewFrameOptions = (T extends undefined } : { state: T }) & { /** - * The new frame should replace the current frame or all the stack. + * The new frame should replace the current frame. */ - replace?: boolean | "all"; + replace?: boolean; /** * The animatedOpen phase of the life cycle. * @@ -427,19 +427,11 @@ const StackedRouter: Component = (oprops) => { animateClose: opts?.animateClose, }; - const replace = opts?.replace; - if (replace === "all") { - mutStack([frame]); + mutStack(opts?.replace ? stack.length - 1 : stack.length, frame); + if (opts?.replace) { + window.history.replaceState(serializableStack(stack), "", path); } else { - mutStack(replace ? stack.length - 1 : stack.length, frame); - } - - const savedStack = serializableStack(stack); - - if (replace) { - window.history.replaceState(savedStack, "", path); - } else { - window.history.pushState(savedStack, "", path); + window.history.pushState(serializableStack(stack), "", path); } return frame; });