Compare commits

..

No commits in common. "4c0925a6a12cdafafdcc4327d0da8d2e9df081a7" and "4c717a0cb7eb479dcd6d6c836d287bacb8d3354d" have entirely different histories.

3 changed files with 8 additions and 16 deletions

View file

@ -167,7 +167,7 @@ export async function getOrRegisterApp(site: string, redirectUrl: string) {
}); });
const app = await client.v1.apps.create({ const app = await client.v1.apps.create({
clientName: "TuTu", clientName: "TuTu",
website: "https://code.lightstands.xyz/Rubicon/tutu", website: "https://github.com/thislight/tutu",
redirectUris: redirectUrl, redirectUris: redirectUrl,
scopes: "read write push", scopes: "read write push",
}); });

View file

@ -64,7 +64,7 @@ export function useSessions() {
if (sessions().length > 0) return; if (sessions().length > 0) return;
push( push(
"/accounts/sign-in?back=" + encodeURIComponent(location.pathname), "/accounts/sign-in?back=" + encodeURIComponent(location.pathname),
{ replace: "all" }, { replace: true },
); );
}); });

View file

@ -36,9 +36,9 @@ export type NewFrameOptions<T> = (T extends undefined
} }
: { state: T }) & { : { 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. * The animatedOpen phase of the life cycle.
* *
@ -427,19 +427,11 @@ const StackedRouter: Component<StackedRouterProps> = (oprops) => {
animateClose: opts?.animateClose, animateClose: opts?.animateClose,
}; };
const replace = opts?.replace; mutStack(opts?.replace ? stack.length - 1 : stack.length, frame);
if (replace === "all") { if (opts?.replace) {
mutStack([frame]); window.history.replaceState(serializableStack(stack), "", path);
} else { } else {
mutStack(replace ? stack.length - 1 : stack.length, frame); window.history.pushState(serializableStack(stack), "", path);
}
const savedStack = serializableStack(stack);
if (replace) {
window.history.replaceState(savedStack, "", path);
} else {
window.history.pushState(savedStack, "", path);
} }
return frame; return frame;
}); });