mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🐛 fix: Fix ssr
This commit is contained in:
@@ -38,13 +38,13 @@ const Chat = memo(() => {
|
||||
});
|
||||
export default Chat;
|
||||
|
||||
export const getStaticPaths = async () => {
|
||||
return {
|
||||
fallback: 'blocking',
|
||||
paths: [],
|
||||
};
|
||||
};
|
||||
// export const getStaticPaths = async () => {
|
||||
// return {
|
||||
// fallback: 'blocking',
|
||||
// paths: [],
|
||||
// };
|
||||
// };
|
||||
|
||||
export const getStaticProps = async (context: any) => ({
|
||||
export const getServerSideProps = async (context: any) => ({
|
||||
props: await serverSideTranslations(context.locale),
|
||||
});
|
||||
|
||||
@@ -5,13 +5,20 @@ import { memo, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { settingsSelectors, useSettings } from '@/store/settings';
|
||||
import { ConfigKeys } from '@/types/exportConfig';
|
||||
|
||||
type SettingItemGroup = ItemGroup & {
|
||||
children: {
|
||||
name: ConfigKeys;
|
||||
}[];
|
||||
};
|
||||
|
||||
const SettingForm = memo(() => {
|
||||
const settings = useSettings(settingsSelectors.currentSettings, isEqual);
|
||||
|
||||
const { t } = useTranslation('setting');
|
||||
|
||||
const theme: ItemGroup = useMemo(
|
||||
const theme: SettingItemGroup = useMemo(
|
||||
() => ({
|
||||
children: [
|
||||
{
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface ConfigSettings {
|
||||
avatar?: string;
|
||||
}
|
||||
|
||||
export type ConfigKeys = keyof ConfigSettings;
|
||||
|
||||
export interface ConfigState {
|
||||
settings: ConfigSettings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user