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() {
const navigationRef = useRef();
useEffect(() => UpdateAsync(), []);
useEffect(UpdateAsync, []);
return (
<NavigationContainer name="Root" ref={navigationRef} style={{ flex: 1 }}>
<Tab.Navigator>

View File

@ -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 (
<View style={{ height: "100%", backgroundColor: "#0099CC" }}>