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