mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(themes): changing theme would bug out
This commit is contained in:
@@ -5,7 +5,7 @@ interface ThemeState {
|
||||
themes: Record<string, string>;
|
||||
setTheme: (subplebbitAddress: string, theme: string) => void;
|
||||
getTheme: (subplebbitAddress: string) => string | null;
|
||||
loadThemes: () => void;
|
||||
loadThemes: () => Promise<void>;
|
||||
}
|
||||
|
||||
const themeStore = localForageLru.createInstance({
|
||||
@@ -35,6 +35,7 @@ const useThemeStore = create<ThemeState>((set: StoreApi<ThemeState>['setState'],
|
||||
},
|
||||
}));
|
||||
|
||||
// Load themes on store initialization
|
||||
useThemeStore.getState().loadThemes();
|
||||
|
||||
export default useThemeStore;
|
||||
|
||||
Reference in New Issue
Block a user