Browse Source

Change mascot popup key

This will ensure old users will still see the popups, even if they dismissed the old banners.
Arnaud Vergnet 4 years ago
parent
commit
2bcbe36f2f

+ 18
- 18
src/managers/AsyncStorageManager.js View File

@@ -41,40 +41,40 @@ export default class AsyncStorageManager {
41 41
       key: 'defaultStartScreen',
42 42
       default: 'home',
43 43
     },
44
-    servicesShowBanner: {
45
-      key: 'servicesShowBanner',
44
+    servicesShowMascot: {
45
+      key: 'servicesShowMascot',
46 46
       default: '1',
47 47
     },
48
-    proxiwashShowBanner: {
49
-      key: 'proxiwashShowBanner',
48
+    proxiwashShowMascot: {
49
+      key: 'proxiwashShowMascot',
50 50
       default: '1',
51 51
     },
52
-    homeShowBanner: {
53
-      key: 'homeShowBanner',
52
+    homeShowMascot: {
53
+      key: 'homeShowMascot',
54 54
       default: '1',
55 55
     },
56
-    eventsShowBanner: {
57
-      key: 'eventsShowBanner',
56
+    eventsShowMascot: {
57
+      key: 'eventsShowMascot',
58 58
       default: '1',
59 59
     },
60
-    planexShowBanner: {
61
-      key: 'planexShowBanner',
60
+    planexShowMascot: {
61
+      key: 'planexShowMascot',
62 62
       default: '1',
63 63
     },
64
-    loginShowBanner: {
65
-      key: 'loginShowBanner',
64
+    loginShowMascot: {
65
+      key: 'loginShowMascot',
66 66
       default: '1',
67 67
     },
68
-    voteShowBanner: {
69
-      key: 'voteShowBanner',
68
+    voteShowMascot: {
69
+      key: 'voteShowMascot',
70 70
       default: '1',
71 71
     },
72
-    equipmentShowBanner: {
73
-      key: 'equipmentShowBanner',
72
+    equipmentShowMascot: {
73
+      key: 'equipmentShowMascot',
74 74
       default: '1',
75 75
     },
76
-    gameStartShowBanner: {
77
-      key: 'gameStartShowBanner',
76
+    gameStartMascot: {
77
+      key: 'gameStartMascot',
78 78
       default: '1',
79 79
     },
80 80
     proxiwashWatchedMachines: {

+ 2
- 2
src/screens/Amicale/Equipment/EquipmentListScreen.js View File

@@ -49,7 +49,7 @@ class EquipmentListScreen extends React.Component<PropsType, StateType> {
49 49
     super(props);
50 50
     this.state = {
51 51
       mascotDialogVisible: AsyncStorageManager.getBool(
52
-        AsyncStorageManager.PREFERENCES.equipmentShowBanner.key,
52
+        AsyncStorageManager.PREFERENCES.equipmentShowMascot.key,
53 53
       ),
54 54
     };
55 55
     this.canRefresh = false;
@@ -141,7 +141,7 @@ class EquipmentListScreen extends React.Component<PropsType, StateType> {
141 141
 
142 142
   hideMascotDialog = () => {
143 143
     AsyncStorageManager.set(
144
-      AsyncStorageManager.PREFERENCES.equipmentShowBanner.key,
144
+      AsyncStorageManager.PREFERENCES.equipmentShowMascot.key,
145 145
       false,
146 146
     );
147 147
     this.setState({mascotDialogVisible: false});

+ 3
- 3
src/screens/Amicale/LoginScreen.js View File

@@ -91,7 +91,7 @@ class LoginScreen extends React.Component<PropsType, StateType> {
91 91
       dialogVisible: false,
92 92
       dialogError: 0,
93 93
       mascotDialogVisible: AsyncStorageManager.getBool(
94
-        AsyncStorageManager.PREFERENCES.loginShowBanner.key,
94
+        AsyncStorageManager.PREFERENCES.loginShowMascot.key,
95 95
       ),
96 96
     };
97 97
   }
@@ -293,7 +293,7 @@ class LoginScreen extends React.Component<PropsType, StateType> {
293 293
 
294 294
   hideMascotDialog = () => {
295 295
     AsyncStorageManager.set(
296
-      AsyncStorageManager.PREFERENCES.loginShowBanner.key,
296
+      AsyncStorageManager.PREFERENCES.loginShowMascot.key,
297 297
       false,
298 298
     );
299 299
     this.setState({mascotDialogVisible: false});
@@ -327,7 +327,7 @@ class LoginScreen extends React.Component<PropsType, StateType> {
327 327
     const {navigation} = this.props;
328 328
     // Do not show the home login banner again
329 329
     AsyncStorageManager.set(
330
-      AsyncStorageManager.PREFERENCES.homeShowBanner.key,
330
+      AsyncStorageManager.PREFERENCES.homeShowMascot.key,
331 331
       false,
332 332
     );
333 333
     if (this.nextScreen == null) navigation.goBack();

+ 2
- 2
src/screens/Amicale/VoteScreen.js View File

@@ -127,7 +127,7 @@ export default class VoteScreen extends React.Component<PropsType, StateType> {
127 127
     this.state = {
128 128
       hasVoted: false,
129 129
       mascotDialogVisible: AsyncStorageManager.getBool(
130
-        AsyncStorageManager.PREFERENCES.voteShowBanner.key,
130
+        AsyncStorageManager.PREFERENCES.voteShowMascot.key,
131 131
       ),
132 132
     };
133 133
     this.hasVoted = false;
@@ -309,7 +309,7 @@ export default class VoteScreen extends React.Component<PropsType, StateType> {
309 309
 
310 310
   hideMascotDialog = () => {
311 311
     AsyncStorageManager.set(
312
-      AsyncStorageManager.PREFERENCES.voteShowBanner.key,
312
+      AsyncStorageManager.PREFERENCES.voteShowMascot.key,
313 313
       false,
314 314
     );
315 315
     this.setState({mascotDialogVisible: false});

+ 1
- 1
src/screens/Game/screens/GameStartScreen.js View File

@@ -420,7 +420,7 @@ class GameStartScreen extends React.Component<PropsType> {
420 420
           <CollapsibleScrollView>
421 421
             {this.getMainContent()}
422 422
             <MascotPopup
423
-              prefKey={AsyncStorageManager.PREFERENCES.gameStartShowBanner.key}
423
+              prefKey={AsyncStorageManager.PREFERENCES.gameStartMascot.key}
424 424
               title={i18n.t('screens.game.mascotDialog.title')}
425 425
               message={i18n.t('screens.game.mascotDialog.message')}
426 426
               icon="gamepad-variant"

+ 1
- 1
src/screens/Home/HomeScreen.js View File

@@ -488,7 +488,7 @@ class HomeScreen extends React.Component<PropsType, StateType> {
488 488
         </View>
489 489
         {!this.isLoggedIn ? (
490 490
           <MascotPopup
491
-            prefKey={AsyncStorageManager.PREFERENCES.homeShowBanner.key}
491
+            prefKey={AsyncStorageManager.PREFERENCES.homeShowMascot.key}
492 492
             title={i18n.t('screens.home.mascotDialog.title')}
493 493
             message={i18n.t('screens.home.mascotDialog.message')}
494 494
             icon="human-greeting"

+ 1
- 1
src/screens/Planex/PlanexScreen.js View File

@@ -361,7 +361,7 @@ class PlanexScreen extends React.Component<PropsType, StateType> {
361 361
           AsyncStorageManager.PREFERENCES.defaultStartScreen.key,
362 362
         ).toLowerCase() !== 'planex' ? (
363 363
           <MascotPopup
364
-            prefKey={AsyncStorageManager.PREFERENCES.planexShowBanner.key}
364
+            prefKey={AsyncStorageManager.PREFERENCES.planexShowMascot.key}
365 365
             title={i18n.t('screens.planex.mascotDialog.title')}
366 366
             message={i18n.t('screens.planex.mascotDialog.message')}
367 367
             icon="emoticon-kiss"

+ 1
- 1
src/screens/Planning/PlanningScreen.js View File

@@ -262,7 +262,7 @@ class PlanningScreen extends React.Component<PropsType, StateType> {
262 262
           onRef={this.onAgendaRef}
263 263
         />
264 264
         <MascotPopup
265
-          prefKey={AsyncStorageManager.PREFERENCES.eventsShowBanner.key}
265
+          prefKey={AsyncStorageManager.PREFERENCES.eventsShowMascot.key}
266 266
           title={i18n.t('screens.planning.mascotDialog.title')}
267 267
           message={i18n.t('screens.planning.mascotDialog.message')}
268 268
           icon="party-popper"

+ 1
- 1
src/screens/Proxiwash/ProxiwashScreen.js View File

@@ -457,7 +457,7 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
457 457
           />
458 458
         </View>
459 459
         <MascotPopup
460
-          prefKey={AsyncStorageManager.PREFERENCES.proxiwashShowBanner.key}
460
+          prefKey={AsyncStorageManager.PREFERENCES.proxiwashShowMascot.key}
461 461
           title={i18n.t('screens.proxiwash.mascotDialog.title')}
462 462
           message={i18n.t('screens.proxiwash.mascotDialog.message')}
463 463
           icon="information"

+ 1
- 1
src/screens/Services/ServicesScreen.js View File

@@ -139,7 +139,7 @@ class ServicesScreen extends React.Component<PropsType> {
139 139
           hasTab
140 140
         />
141 141
         <MascotPopup
142
-          prefKey={AsyncStorageManager.PREFERENCES.servicesShowBanner.key}
142
+          prefKey={AsyncStorageManager.PREFERENCES.servicesShowMascot.key}
143 143
           title={i18n.t('screens.services.mascotDialog.title')}
144 144
           message={i18n.t('screens.services.mascotDialog.message')}
145 145
           icon="cloud-question"

Loading…
Cancel
Save