From 2bcbe36f2f9e846c707b8f7c5d2fa82f60a5bb01 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Fri, 14 Aug 2020 17:45:49 +0200 Subject: [PATCH] Change mascot popup key This will ensure old users will still see the popups, even if they dismissed the old banners. --- src/managers/AsyncStorageManager.js | 36 +++++++++---------- .../Amicale/Equipment/EquipmentListScreen.js | 4 +-- src/screens/Amicale/LoginScreen.js | 6 ++-- src/screens/Amicale/VoteScreen.js | 4 +-- src/screens/Game/screens/GameStartScreen.js | 2 +- src/screens/Home/HomeScreen.js | 2 +- src/screens/Planex/PlanexScreen.js | 2 +- src/screens/Planning/PlanningScreen.js | 2 +- src/screens/Proxiwash/ProxiwashScreen.js | 2 +- src/screens/Services/ServicesScreen.js | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/managers/AsyncStorageManager.js b/src/managers/AsyncStorageManager.js index fc38060..f5bc046 100644 --- a/src/managers/AsyncStorageManager.js +++ b/src/managers/AsyncStorageManager.js @@ -41,40 +41,40 @@ export default class AsyncStorageManager { key: 'defaultStartScreen', default: 'home', }, - servicesShowBanner: { - key: 'servicesShowBanner', + servicesShowMascot: { + key: 'servicesShowMascot', default: '1', }, - proxiwashShowBanner: { - key: 'proxiwashShowBanner', + proxiwashShowMascot: { + key: 'proxiwashShowMascot', default: '1', }, - homeShowBanner: { - key: 'homeShowBanner', + homeShowMascot: { + key: 'homeShowMascot', default: '1', }, - eventsShowBanner: { - key: 'eventsShowBanner', + eventsShowMascot: { + key: 'eventsShowMascot', default: '1', }, - planexShowBanner: { - key: 'planexShowBanner', + planexShowMascot: { + key: 'planexShowMascot', default: '1', }, - loginShowBanner: { - key: 'loginShowBanner', + loginShowMascot: { + key: 'loginShowMascot', default: '1', }, - voteShowBanner: { - key: 'voteShowBanner', + voteShowMascot: { + key: 'voteShowMascot', default: '1', }, - equipmentShowBanner: { - key: 'equipmentShowBanner', + equipmentShowMascot: { + key: 'equipmentShowMascot', default: '1', }, - gameStartShowBanner: { - key: 'gameStartShowBanner', + gameStartMascot: { + key: 'gameStartMascot', default: '1', }, proxiwashWatchedMachines: { diff --git a/src/screens/Amicale/Equipment/EquipmentListScreen.js b/src/screens/Amicale/Equipment/EquipmentListScreen.js index ed91b12..118d860 100644 --- a/src/screens/Amicale/Equipment/EquipmentListScreen.js +++ b/src/screens/Amicale/Equipment/EquipmentListScreen.js @@ -49,7 +49,7 @@ class EquipmentListScreen extends React.Component { super(props); this.state = { mascotDialogVisible: AsyncStorageManager.getBool( - AsyncStorageManager.PREFERENCES.equipmentShowBanner.key, + AsyncStorageManager.PREFERENCES.equipmentShowMascot.key, ), }; this.canRefresh = false; @@ -141,7 +141,7 @@ class EquipmentListScreen extends React.Component { hideMascotDialog = () => { AsyncStorageManager.set( - AsyncStorageManager.PREFERENCES.equipmentShowBanner.key, + AsyncStorageManager.PREFERENCES.equipmentShowMascot.key, false, ); this.setState({mascotDialogVisible: false}); diff --git a/src/screens/Amicale/LoginScreen.js b/src/screens/Amicale/LoginScreen.js index d7fa50c..9a23715 100644 --- a/src/screens/Amicale/LoginScreen.js +++ b/src/screens/Amicale/LoginScreen.js @@ -91,7 +91,7 @@ class LoginScreen extends React.Component { dialogVisible: false, dialogError: 0, mascotDialogVisible: AsyncStorageManager.getBool( - AsyncStorageManager.PREFERENCES.loginShowBanner.key, + AsyncStorageManager.PREFERENCES.loginShowMascot.key, ), }; } @@ -293,7 +293,7 @@ class LoginScreen extends React.Component { hideMascotDialog = () => { AsyncStorageManager.set( - AsyncStorageManager.PREFERENCES.loginShowBanner.key, + AsyncStorageManager.PREFERENCES.loginShowMascot.key, false, ); this.setState({mascotDialogVisible: false}); @@ -327,7 +327,7 @@ class LoginScreen extends React.Component { const {navigation} = this.props; // Do not show the home login banner again AsyncStorageManager.set( - AsyncStorageManager.PREFERENCES.homeShowBanner.key, + AsyncStorageManager.PREFERENCES.homeShowMascot.key, false, ); if (this.nextScreen == null) navigation.goBack(); diff --git a/src/screens/Amicale/VoteScreen.js b/src/screens/Amicale/VoteScreen.js index 817984d..6b11828 100644 --- a/src/screens/Amicale/VoteScreen.js +++ b/src/screens/Amicale/VoteScreen.js @@ -127,7 +127,7 @@ export default class VoteScreen extends React.Component { this.state = { hasVoted: false, mascotDialogVisible: AsyncStorageManager.getBool( - AsyncStorageManager.PREFERENCES.voteShowBanner.key, + AsyncStorageManager.PREFERENCES.voteShowMascot.key, ), }; this.hasVoted = false; @@ -309,7 +309,7 @@ export default class VoteScreen extends React.Component { hideMascotDialog = () => { AsyncStorageManager.set( - AsyncStorageManager.PREFERENCES.voteShowBanner.key, + AsyncStorageManager.PREFERENCES.voteShowMascot.key, false, ); this.setState({mascotDialogVisible: false}); diff --git a/src/screens/Game/screens/GameStartScreen.js b/src/screens/Game/screens/GameStartScreen.js index f80ba60..7e2ab61 100644 --- a/src/screens/Game/screens/GameStartScreen.js +++ b/src/screens/Game/screens/GameStartScreen.js @@ -420,7 +420,7 @@ class GameStartScreen extends React.Component { {this.getMainContent()} { {!this.isLoggedIn ? ( { AsyncStorageManager.PREFERENCES.defaultStartScreen.key, ).toLowerCase() !== 'planex' ? ( { onRef={this.onAgendaRef} /> { /> { hasTab />