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