From 343a0ad06e7d37d053c4c51fe241b72143400bdc Mon Sep 17 00:00:00 2001 From: harukin-DeskMini Date: Sat, 5 Nov 2022 22:11:23 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.js | 2 +- components/settings.js | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) 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 (