Merge commit '655f174321ccfe35b1631adf568f590dc6286b03' into develop
This commit is contained in:
commit
97d05571e5
21
App.js
21
App.js
@ -67,7 +67,7 @@ export default function App() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NavigationContainer name="Root" style={{ flex: 1 }}>
|
<NavigationContainer name="Root" style={{ flex: 1 }}>
|
||||||
<Tab.Navigator>
|
<Tab.Navigator detachInactiveScreens={false}>
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
name="login"
|
name="login"
|
||||||
options={{
|
options={{
|
||||||
@ -228,7 +228,24 @@ const Top = ({
|
|||||||
</Stack.Navigator>
|
</Stack.Navigator>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
function MenuPage({ favoriteStation, setFavoriteStation, busAndTrainData }) {
|
function MenuPage({
|
||||||
|
navigation,
|
||||||
|
favoriteStation,
|
||||||
|
setFavoriteStation,
|
||||||
|
busAndTrainData,
|
||||||
|
}) {
|
||||||
|
useEffect(() => {
|
||||||
|
const unsubscribe = navigation.addListener("tabPress", (e) => {
|
||||||
|
AS.getItem("favoriteStation")
|
||||||
|
.then((d) => {
|
||||||
|
const returnData = JSON.parse(d);
|
||||||
|
setFavoriteStation(returnData);
|
||||||
|
})
|
||||||
|
.catch((d) => console.log(d));
|
||||||
|
});
|
||||||
|
|
||||||
|
return unsubscribe;
|
||||||
|
}, [navigation]);
|
||||||
return (
|
return (
|
||||||
<Stack.Navigator>
|
<Stack.Navigator>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
@ -37,7 +37,6 @@ export const StationDeteilView = (props) => {
|
|||||||
});
|
});
|
||||||
if (data.length == 0) {
|
if (data.length == 0) {
|
||||||
setTrainBus();
|
setTrainBus();
|
||||||
return () => {};
|
|
||||||
}
|
}
|
||||||
setTrainBus(data[0]);
|
setTrainBus(data[0]);
|
||||||
}, [currentStation]);
|
}, [currentStation]);
|
||||||
|
Loading…
Reference in New Issue
Block a user