This commit is contained in:
harukin-DeskMini 2022-11-05 22:11:23 +09:00
parent 48a8dba1c0
commit 343a0ad06e
2 changed files with 4 additions and 10 deletions

2
App.js
View File

@ -25,7 +25,7 @@ if (Platform.OS === "android") {
} }
export default function App() { export default function App() {
const navigationRef = useRef(); const navigationRef = useRef();
useEffect(() => UpdateAsync(), []); useEffect(UpdateAsync, []);
return ( return (
<NavigationContainer name="Root" ref={navigationRef} style={{ flex: 1 }}> <NavigationContainer name="Root" ref={navigationRef} style={{ flex: 1 }}>
<Tab.Navigator> <Tab.Navigator>

View File

@ -14,15 +14,9 @@ export default function Setting(props) {
const [mapSwitch, setMapSwitch] = useState(undefined); const [mapSwitch, setMapSwitch] = useState(undefined);
const [stationMenu, setStationMenu] = useState(undefined); const [stationMenu, setStationMenu] = useState(undefined);
useEffect(() => { useEffect(() => {
AsyncStorage.getItem("iconSwitch").then((d) => { AsyncStorage.getItem("iconSwitch").then(setIconSetting);
setIconSetting(d); AsyncStorage.getItem("mapSwitch").then(setMapSwitch);
}); AsyncStorage.getItem("stationSwitch").then(setStationMenu);
AsyncStorage.getItem("mapSwitch").then((d) => {
setMapSwitch(d);
});
AsyncStorage.getItem("stationSwitch").then((d) => {
setStationMenu(d);
});
}, []); }, []);
return ( return (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}> <View style={{ height: "100%", backgroundColor: "#0099CC" }}>