mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-31 20:24:27 -04:00
Fix page props types (#565)
This commit is contained in:
parent
1f7443336e
commit
7209b7d0a6
@ -47,7 +47,7 @@ export const withTranslations = (
|
|||||||
...commonOptions,
|
...commonOptions,
|
||||||
lng: props.pageProps.__lang,
|
lng: props.pageProps.__lang,
|
||||||
});
|
});
|
||||||
i18next.systemLanguage = props.pageProps.__sysLang;
|
i18next.systemLanguage = props.pageProps?.__sysLang;
|
||||||
return i18next;
|
return i18next;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -66,6 +66,7 @@ export const withTranslations = (
|
|||||||
lng,
|
lng,
|
||||||
});
|
});
|
||||||
i18n.systemLanguage = sysLng;
|
i18n.systemLanguage = sysLng;
|
||||||
|
props.pageProps ??= {};
|
||||||
props.pageProps.__lang = lng;
|
props.pageProps.__lang = lng;
|
||||||
props.pageProps.__sysLang = sysLng;
|
props.pageProps.__sysLang = sysLng;
|
||||||
return props;
|
return props;
|
||||||
|
@ -264,12 +264,12 @@ App.getInitialProps = async (ctx: AppContext) => {
|
|||||||
) {
|
) {
|
||||||
ctx.ctx.res!.writeHead(307, { Location: `/setup?step=${info!.setupStatus}` });
|
ctx.ctx.res!.writeHead(307, { Location: `/setup?step=${info!.setupStatus}` });
|
||||||
ctx.ctx.res!.end();
|
ctx.ctx.res!.end();
|
||||||
return {} as any;
|
return { pageProps: {} };
|
||||||
}
|
}
|
||||||
if (info!.setupStatus === SetupStep.Done && ctx.router.route === "/setup") {
|
if (info!.setupStatus === SetupStep.Done && ctx.router.route === "/setup") {
|
||||||
ctx.ctx.res!.writeHead(307, { Location: "/" });
|
ctx.ctx.res!.writeHead(307, { Location: "/" });
|
||||||
ctx.ctx.res!.end();
|
ctx.ctx.res!.end();
|
||||||
return {} as any;
|
return { pageProps: {} };
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("SSR error, disabling it.");
|
console.error("SSR error, disabling it.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user