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