diff --git a/App.js b/App.js index ffc9ddf..f03ea13 100644 --- a/App.js +++ b/App.js @@ -25,7 +25,7 @@ if (Platform.OS === "android") { } export default function App() { const navigationRef = useRef(); - useEffect(() => UpdateAsync(), []); + useEffect(UpdateAsync, []); return ( diff --git a/components/settings.js b/components/settings.js index 80d5092..c0cd1a4 100644 --- a/components/settings.js +++ b/components/settings.js @@ -14,15 +14,9 @@ export default function Setting(props) { const [mapSwitch, setMapSwitch] = useState(undefined); const [stationMenu, setStationMenu] = useState(undefined); useEffect(() => { - AsyncStorage.getItem("iconSwitch").then((d) => { - setIconSetting(d); - }); - AsyncStorage.getItem("mapSwitch").then((d) => { - setMapSwitch(d); - }); - AsyncStorage.getItem("stationSwitch").then((d) => { - setStationMenu(d); - }); + AsyncStorage.getItem("iconSwitch").then(setIconSetting); + AsyncStorage.getItem("mapSwitch").then(setMapSwitch); + AsyncStorage.getItem("stationSwitch").then(setStationMenu); }, []); return (