Fix login links no working on mobile

This commit is contained in:
Zoe Roux 2024-03-31 22:57:24 +02:00
parent d3ec0cab9b
commit 61a8b07f4b
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ export const LoginPage: QueryPage<{ apiUrl?: string; error?: string }> = ({
useEffect(() => { useEffect(() => {
if (!apiUrl && Platform.OS !== "web") if (!apiUrl && Platform.OS !== "web")
router.replace("/server-url", undefined, { router.replace("/server-url", undefined, {
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true }, experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
}); });
}, [apiUrl, router]); }, [apiUrl, router]);
@ -74,7 +74,7 @@ export const LoginPage: QueryPage<{ apiUrl?: string; error?: string }> = ({
setError(error); setError(error);
if (error) return; if (error) return;
router.replace("/", undefined, { router.replace("/", undefined, {
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true }, experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
}); });
}} }}
{...css({ {...css({

View File

@ -106,7 +106,7 @@ export const OidcCallbackPage: QueryPage<{
function onError(error: string) { function onError(error: string) {
router.replace({ pathname: "/login", query: { error, apiUrl } }, undefined, { router.replace({ pathname: "/login", query: { error, apiUrl } }, undefined, {
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true }, experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
}); });
} }
async function run() { async function run() {
@ -114,7 +114,7 @@ export const OidcCallbackPage: QueryPage<{
if (loginError) onError(loginError); if (loginError) onError(loginError);
else { else {
router.replace("/", undefined, { router.replace("/", undefined, {
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true }, experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
}); });
} }
} }

View File

@ -45,7 +45,7 @@ export const RegisterPage: QueryPage<{ apiUrl?: string }> = ({ apiUrl }) => {
useEffect(() => { useEffect(() => {
if (!apiUrl && Platform.OS !== "web") if (!apiUrl && Platform.OS !== "web")
router.replace("/server-url", undefined, { router.replace("/server-url", undefined, {
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true }, experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
}); });
}, [apiUrl, router]); }, [apiUrl, router]);
@ -85,7 +85,7 @@ export const RegisterPage: QueryPage<{ apiUrl?: string }> = ({ apiUrl }) => {
setError(error); setError(error);
if (error) return; if (error) return;
router.replace("/", undefined, { router.replace("/", undefined, {
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true }, experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
}); });
}} }}
{...css({ {...css({