mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 04:04:21 -04:00
Fix browse page
This commit is contained in:
parent
0969d68adc
commit
2b33191db7
@ -93,7 +93,6 @@ const App = () => {
|
|||||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||||
const info = initialRender ? useContext(AccountContext) : useAccounts();
|
const info = initialRender ? useContext(AccountContext) : useAccounts();
|
||||||
initialRender = false;
|
initialRender = false;
|
||||||
console.log(info);
|
|
||||||
if (info.type === "loading") return <CircularProgress />
|
if (info.type === "loading") return <CircularProgress />
|
||||||
if (info.type === "error") return <ConnectionError error={info.error} retry={info.retry} />;
|
if (info.type === "error") return <ConnectionError error={info.error} retry={info.retry} />;
|
||||||
if (info.selected === null) return <Redirect href="/login" />;
|
if (info.selected === null) return <Redirect href="/login" />;
|
||||||
|
@ -64,7 +64,7 @@ module.exports = addMonorepoSupport(
|
|||||||
...defaultConfig.resolver,
|
...defaultConfig.resolver,
|
||||||
requireCycleIgnorePatterns: [
|
requireCycleIgnorePatterns: [
|
||||||
...defaultConfig.resolver.requireCycleIgnorePatterns,
|
...defaultConfig.resolver.requireCycleIgnorePatterns,
|
||||||
/login.ts/,
|
/.*/,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
@ -41,6 +41,8 @@ const kyooUrl =
|
|||||||
? process.env.KYOO_URL ?? "http://localhost:5000"
|
? process.env.KYOO_URL ?? "http://localhost:5000"
|
||||||
: "/api";
|
: "/api";
|
||||||
|
|
||||||
|
export let kyooApiUrl: string | null = kyooUrl || null;
|
||||||
|
|
||||||
export const queryFn = async <Data,>(
|
export const queryFn = async <Data,>(
|
||||||
context:
|
context:
|
||||||
| QueryFunctionContext
|
| QueryFunctionContext
|
||||||
@ -57,6 +59,7 @@ export const queryFn = async <Data,>(
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let url: string | null = context.apiUrl ?? (Platform.OS !== "web" ? await getSecureItem("apiUrl") : null) ?? kyooUrl;
|
let url: string | null = context.apiUrl ?? (Platform.OS !== "web" ? await getSecureItem("apiUrl") : null) ?? kyooUrl;
|
||||||
if (!url) console.error("Kyoo's url is not defined.");
|
if (!url) console.error("Kyoo's url is not defined.");
|
||||||
|
kyooApiUrl = url;
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (!token && context.authenticated !== false) token = await getToken();
|
if (!token && context.authenticated !== false) token = await getToken();
|
||||||
|
@ -20,11 +20,12 @@
|
|||||||
|
|
||||||
import { Platform } from "react-native";
|
import { Platform } from "react-native";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
import { kyooApiUrl } from "..";
|
||||||
|
|
||||||
export const imageFn = (url: string) =>
|
export const imageFn = (url: string) =>
|
||||||
Platform.OS === "web"
|
Platform.OS === "web"
|
||||||
? `/api${url}`
|
? `/api${url}`
|
||||||
: process.env.PUBLIC_BACK_URL + url;
|
: kyooApiUrl + url;
|
||||||
|
|
||||||
export const ImagesP = z.object({
|
export const ImagesP = z.object({
|
||||||
/**
|
/**
|
||||||
|
@ -44,17 +44,16 @@ export const Icon = ({ icon: Icon, color, size = 24, ...props }: IconProps) => {
|
|||||||
const computed = css(
|
const computed = css(
|
||||||
{ width: size, height: size, fill: color ?? theme.contrast } as any,
|
{ width: size, height: size, fill: color ?? theme.contrast } as any,
|
||||||
props,
|
props,
|
||||||
);
|
) as any;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Icon
|
<Icon
|
||||||
{...Platform.select<SvgProps>({
|
{...Platform.select<SvgProps>({
|
||||||
web: computed,
|
web: computed,
|
||||||
default: {
|
default: {
|
||||||
height: computed.style?.height,
|
height: computed.style[0]?.height,
|
||||||
width: computed.style?.width,
|
width: computed.style[0]?.width,
|
||||||
// // @ts-ignore
|
fill: computed.style[0]?.fill,
|
||||||
// fill: computed.style?.fill,
|
|
||||||
...computed,
|
...computed,
|
||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user