mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-30 19:54:16 -04:00
Fix oidc links opening two times on web
This commit is contained in:
parent
c6dd7203bb
commit
25b7903c37
@ -95,12 +95,13 @@ export const PressableFeedback = forwardRef<View, PressableProps>(function Feedb
|
||||
});
|
||||
|
||||
export const Link = ({
|
||||
href,
|
||||
href: link,
|
||||
replace,
|
||||
target,
|
||||
children,
|
||||
...props
|
||||
}: { href?: string | UrlObject | null; target?: string; replace?: boolean } & PressableProps) => {
|
||||
const href = link && typeof link === "object" ? parseNextPath(link) : link;
|
||||
const linkProps = useLink({
|
||||
href: href ?? "#",
|
||||
replace,
|
||||
@ -115,11 +116,7 @@ export const Link = ({
|
||||
onPress={(e?: any) => {
|
||||
props?.onPress?.(e);
|
||||
if (e?.defaultPrevented) return;
|
||||
if (
|
||||
(Platform.OS !== "web" && typeof href === "string" && href?.includes("://")) ||
|
||||
(typeof href === "object" && href?.pathname?.includes("://"))
|
||||
)
|
||||
Linking.openURL(typeof href === "object" ? parseNextPath(href) : href);
|
||||
if (Platform.OS !== "web" && href?.includes("://")) Linking.openURL(href);
|
||||
else linkProps.onPress(e);
|
||||
}}
|
||||
>
|
||||
|
@ -50,7 +50,6 @@ export const OidcLogin = ({ apiUrl }: { apiUrl?: string }) => {
|
||||
<Button
|
||||
as={Link}
|
||||
href={{ pathname: x.link, query: { apiUrl } }}
|
||||
target="_blank"
|
||||
key={x.displayName}
|
||||
licon={
|
||||
x.logoUrl != null && (
|
||||
|
@ -71,7 +71,6 @@ 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