Reflect laundromat change when opening proxiwash screen

This commit is contained in:
Arnaud Vergnet 2020-09-21 17:32:15 +02:00
parent b27864858b
commit b654a928a2

View file

@ -130,6 +130,19 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
</MaterialHeaderButtons>
),
});
navigation.addListener('focus', this.onScreenFocus);
}
onScreenFocus = () => {
const {state} = this;
const selected = AsyncStorageManager.getString(
AsyncStorageManager.PREFERENCES.selectedWash.key,
);
if (selected !== state.selectedWash) {
this.setState({
selectedWash: selected
});
}
}
/**