diff --git a/package.json b/package.json index 7a41363..69d5ebe 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "antd-style": "^3.6.1", "classnames": "^2.5.1", "dayjs": "^1.11.10", - "dexie": "^4.0.0", + "dexie": "^4.3.0", "numeral": "^2.0.6", "omit.js": "^2.0.2", "querystring": "^0.2.1", diff --git a/src/app.tsx b/src/app.tsx index 6702e82..22416e9 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -32,26 +32,43 @@ function LayoutChildrenWrapper({ setInitialState: any; }) { const isMobile = useIsMobile(); + const { effectiveTheme, getCurrentColorScheme, fetchThemePreferences } = useModel('theme'); + + useEffect(() => { + fetchThemePreferences(); + }, [fetchThemePreferences]); + + const colorScheme = getCurrentColorScheme(); + useNotifications(); return ( - <> - {children} - {isMobile && } - {isDev && ( - { - setInitialState((preInitialState: any) => ({ - ...preInitialState, - settings, - })); - }} - /> - )} - + + <> + {children} + {isMobile && } + {isDev && ( + { + setInitialState((preInitialState: any) => ({ + ...preInitialState, + settings, + })); + }} + /> + )} + + ); } @@ -128,35 +145,3 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = export const request: RequestConfig = { ...errorConfig, }; - -/** - * Theme Provider Wrapper - * Wraps the entire app with ConfigProvider to apply theme - */ -export function rootContainer(container: any) { - return {container}; -} - -function ThemeProvider({ children }: { children: React.ReactNode }) { - const { effectiveTheme, getCurrentColorScheme, fetchThemePreferences } = useModel('theme'); - - // Fetch theme preferences on mount - useEffect(() => { - fetchThemePreferences(); - }, [fetchThemePreferences]); - - const colorScheme = getCurrentColorScheme(); - - return ( - - {children} - - ); -} diff --git a/src/types/sync.d.ts b/src/types/sync.d.ts index 55a1467..22a6252 100644 --- a/src/types/sync.d.ts +++ b/src/types/sync.d.ts @@ -154,7 +154,6 @@ declare namespace API { updatedAt: Date; syncStatus: SyncStatus; } -} /** * Sync status