mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Fix replace behavior on android
This commit is contained in:
parent
f352085f62
commit
c5b0a76982
@ -49,7 +49,7 @@ export const A = ({
|
|||||||
replace
|
replace
|
||||||
? {
|
? {
|
||||||
nativeBehavior: "stack-replace",
|
nativeBehavior: "stack-replace",
|
||||||
isNestedNavigator: false,
|
isNestedNavigator: true,
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ export const Link = ({
|
|||||||
const linkProps = useLink({
|
const linkProps = useLink({
|
||||||
href: href ?? "#",
|
href: href ?? "#",
|
||||||
replace,
|
replace,
|
||||||
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
// @ts-ignore Missing hrefAttrs type definition.
|
// @ts-ignore Missing hrefAttrs type definition.
|
||||||
linkProps.hrefAttrs = { ...linkProps.hrefAttrs, target };
|
linkProps.hrefAttrs = { ...linkProps.hrefAttrs, target };
|
||||||
|
@ -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: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
}, [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: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
{...css({
|
{...css({
|
||||||
|
@ -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: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
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: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
}, [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: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
{...css({
|
{...css({
|
||||||
|
@ -157,11 +157,11 @@ export const Player = ({
|
|||||||
if (!data) return;
|
if (!data) return;
|
||||||
if (data.type === "movie")
|
if (data.type === "movie")
|
||||||
router.replace(`/movie/${data.slug}`, undefined, {
|
router.replace(`/movie/${data.slug}`, undefined, {
|
||||||
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
else
|
else
|
||||||
router.replace(next ?? `/show/${data.show!.slug}`, undefined, {
|
router.replace(next ?? `/show/${data.show!.slug}`, undefined, {
|
||||||
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: false },
|
experimental: { nativeBehavior: "stack-replace", isNestedNavigator: true },
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
{...css(StyleSheet.absoluteFillObject)}
|
{...css(StyleSheet.absoluteFillObject)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user