mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix oidc routing
This commit is contained in:
parent
f1707db5fb
commit
7abb66b86f
@ -24,6 +24,7 @@ import { TextLink, useLink } from "solito/link";
|
||||
import { useTheme, useYoshiki } from "yoshiki/native";
|
||||
import type { UrlObject } from "url";
|
||||
import { alpha } from "./themes";
|
||||
import { parseNextPath } from "solito/router";
|
||||
|
||||
export const A = ({
|
||||
href,
|
||||
@ -114,8 +115,11 @@ export const Link = ({
|
||||
onPress={(e?: any) => {
|
||||
props?.onPress?.(e);
|
||||
if (e?.defaultPrevented) return;
|
||||
if (Platform.OS !== "web" && typeof href === "string" && href?.includes("://"))
|
||||
Linking.openURL(href);
|
||||
if (
|
||||
(Platform.OS !== "web" && typeof href === "string" && href?.includes("://")) ||
|
||||
(typeof href === "object" && href?.pathname?.includes("://"))
|
||||
)
|
||||
Linking.openURL(typeof href === "object" ? parseNextPath(href) : href);
|
||||
else linkProps.onPress(e);
|
||||
}}
|
||||
>
|
||||
|
@ -50,6 +50,7 @@ export const OidcLogin = ({ apiUrl }: { apiUrl?: string }) => {
|
||||
<Button
|
||||
as={Link}
|
||||
href={{ pathname: x.link, query: { apiUrl } }}
|
||||
target="_blank"
|
||||
key={x.displayName}
|
||||
licon={
|
||||
x.logoUrl != null && (
|
||||
|
@ -72,6 +72,7 @@ export const ServerUrlPage: QueryPage = () => {
|
||||
<Link
|
||||
key={x.displayName}
|
||||
href={{ pathname: x.link, query: { apiUrl } }}
|
||||
target="_blank"
|
||||
{...css({ justifyContent: "center" })}
|
||||
>
|
||||
{x.logoUrl != null ? (
|
||||
|
Loading…
x
Reference in New Issue
Block a user