From b654a928a25a9f87912f0472d9e5d38ba973edea Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Mon, 21 Sep 2020 17:32:15 +0200 Subject: [PATCH] Reflect laundromat change when opening proxiwash screen --- src/screens/Proxiwash/ProxiwashScreen.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/screens/Proxiwash/ProxiwashScreen.js b/src/screens/Proxiwash/ProxiwashScreen.js index 2306646..1d72c3c 100644 --- a/src/screens/Proxiwash/ProxiwashScreen.js +++ b/src/screens/Proxiwash/ProxiwashScreen.js @@ -130,6 +130,19 @@ class ProxiwashScreen extends React.Component { ), }); + 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 + }); + } } /**