diff --git a/phone/src/apps/settings/components/SettingsApp.tsx b/phone/src/apps/settings/components/SettingsApp.tsx index ac7eaeb..5d589e7 100644 --- a/phone/src/apps/settings/components/SettingsApp.tsx +++ b/phone/src/apps/settings/components/SettingsApp.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { AppWrapper } from '../../../ui/components'; import { AppTitle } from '../../../ui/components/AppTitle'; import { AppContent } from '../../../ui/components/AppContent'; @@ -36,9 +36,14 @@ export const SettingsApp = () => { const settingsApp = useApp('SETTINGS'); const [config] = useConfig(); const { setSettings, settings } = useSettings(); - const [, setVal, getStorageItem] = useLocalStorage(); + const [localVal, setVal, getStorageItem] = useLocalStorage(); const simcard = useSimcard(); + useEffect(() => { + console.log('new localstorage'); + // this will be used to trigger a alert that gives feedback when the a setting is changed + }, [localVal]); + const wallpapers = config.wallpapers.map( MapStringOptions(getStorageItem('wallpaper'), (val: string) => setVal('wallpaper', val) diff --git a/phone/src/config/hooks/useConfig.ts b/phone/src/config/hooks/useConfig.ts index 617940e..ab2b06e 100644 --- a/phone/src/config/hooks/useConfig.ts +++ b/phone/src/config/hooks/useConfig.ts @@ -9,7 +9,7 @@ const configState = atom({ export const useConfig = (state: any = configState): any => { const [, setVal] = useLocalStorage(); - const [config, _setConfig] = useRecoilState(state); + const [config] = useRecoilState(state); const setConfig = (key, value) => { console.log(`setConfig: ${key} ${value}`);