mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
fix(localStorage): solution to localStorage issue
Still need to find a good way to re-render
This commit is contained in:
1 parent
07dc73f0cb
commit
5fdb9ba21c
7 files changed
+51
-53
No files matched your search
@@ -2,8 +2,9 @@ import Default from '../default.json';
|
||||
import { useConfig } from '../../../config/hooks/useConfig';
|
||||
import { atom } from 'recoil';
|
||||
import { createMuiTheme } from '@material-ui/core';
|
||||
import useLocalStorage from '../../../os/phone/hooks/useLocalStorage';
|
||||
import { getStorageItem } from '../../../os/phone/hooks/getLocalStorage';
|
||||
import useLocalStorage, {
|
||||
getStorage,
|
||||
} from '../../../os/phone/hooks/useLocalStorage';
|
||||
|
||||
const settingsState = atom({
|
||||
key: 'settings',
|
||||
@@ -11,9 +12,8 @@ const settingsState = atom({
|
||||
});
|
||||
|
||||
export const useSettings = (): any => {
|
||||
const theme = getStorageItem('theme');
|
||||
const [settings, setSettings] = useLocalStorage();
|
||||
const theme = getStorage('theme');
|
||||
const [config] = useConfig();
|
||||
const currentTheme = () => createMuiTheme(config.themes[theme]);
|
||||
return { settings, setSettings, currentTheme };
|
||||
return { currentTheme };
|
||||
};
|
||||
Reference in new issue
Block a user