forked from vergnet/application-amicale
Reflect laundromat change when opening proxiwash screen
This commit is contained in:
parent
b27864858b
commit
b654a928a2
1 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue