Browse Source

Reflect laundromat change when opening proxiwash screen

Arnaud Vergnet 1 year ago
parent
commit
b654a928a2
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      src/screens/Proxiwash/ProxiwashScreen.js

+ 13
- 0
src/screens/Proxiwash/ProxiwashScreen.js View File

@@ -130,6 +130,19 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
130 130
         </MaterialHeaderButtons>
131 131
       ),
132 132
     });
133
+    navigation.addListener('focus', this.onScreenFocus);
134
+  }
135
+
136
+  onScreenFocus = () => {
137
+    const {state} = this;
138
+    const selected = AsyncStorageManager.getString(
139
+      AsyncStorageManager.PREFERENCES.selectedWash.key,
140
+    );
141
+    if (selected !== state.selectedWash) {
142
+      this.setState({
143
+        selectedWash: selected
144
+      });
145
+    }
133 146
   }
134 147
 
135 148
   /**

Loading…
Cancel
Save