Change mascot popup key

This will ensure old users will still see the popups, even if they dismissed the old banners.
This commit is contained in:
Arnaud Vergnet 2020-08-14 17:45:49 +02:00
parent faea54487a
commit 2bcbe36f2f
10 changed files with 31 additions and 31 deletions

View file

@ -41,40 +41,40 @@ export default class AsyncStorageManager {
key: 'defaultStartScreen', key: 'defaultStartScreen',
default: 'home', default: 'home',
}, },
servicesShowBanner: { servicesShowMascot: {
key: 'servicesShowBanner', key: 'servicesShowMascot',
default: '1', default: '1',
}, },
proxiwashShowBanner: { proxiwashShowMascot: {
key: 'proxiwashShowBanner', key: 'proxiwashShowMascot',
default: '1', default: '1',
}, },
homeShowBanner: { homeShowMascot: {
key: 'homeShowBanner', key: 'homeShowMascot',
default: '1', default: '1',
}, },
eventsShowBanner: { eventsShowMascot: {
key: 'eventsShowBanner', key: 'eventsShowMascot',
default: '1', default: '1',
}, },
planexShowBanner: { planexShowMascot: {
key: 'planexShowBanner', key: 'planexShowMascot',
default: '1', default: '1',
}, },
loginShowBanner: { loginShowMascot: {
key: 'loginShowBanner', key: 'loginShowMascot',
default: '1', default: '1',
}, },
voteShowBanner: { voteShowMascot: {
key: 'voteShowBanner', key: 'voteShowMascot',
default: '1', default: '1',
}, },
equipmentShowBanner: { equipmentShowMascot: {
key: 'equipmentShowBanner', key: 'equipmentShowMascot',
default: '1', default: '1',
}, },
gameStartShowBanner: { gameStartMascot: {
key: 'gameStartShowBanner', key: 'gameStartMascot',
default: '1', default: '1',
}, },
proxiwashWatchedMachines: { proxiwashWatchedMachines: {

View file

@ -49,7 +49,7 @@ class EquipmentListScreen extends React.Component<PropsType, StateType> {
super(props); super(props);
this.state = { this.state = {
mascotDialogVisible: AsyncStorageManager.getBool( mascotDialogVisible: AsyncStorageManager.getBool(
AsyncStorageManager.PREFERENCES.equipmentShowBanner.key, AsyncStorageManager.PREFERENCES.equipmentShowMascot.key,
), ),
}; };
this.canRefresh = false; this.canRefresh = false;
@ -141,7 +141,7 @@ class EquipmentListScreen extends React.Component<PropsType, StateType> {
hideMascotDialog = () => { hideMascotDialog = () => {
AsyncStorageManager.set( AsyncStorageManager.set(
AsyncStorageManager.PREFERENCES.equipmentShowBanner.key, AsyncStorageManager.PREFERENCES.equipmentShowMascot.key,
false, false,
); );
this.setState({mascotDialogVisible: false}); this.setState({mascotDialogVisible: false});

View file

@ -91,7 +91,7 @@ class LoginScreen extends React.Component<PropsType, StateType> {
dialogVisible: false, dialogVisible: false,
dialogError: 0, dialogError: 0,
mascotDialogVisible: AsyncStorageManager.getBool( mascotDialogVisible: AsyncStorageManager.getBool(
AsyncStorageManager.PREFERENCES.loginShowBanner.key, AsyncStorageManager.PREFERENCES.loginShowMascot.key,
), ),
}; };
} }
@ -293,7 +293,7 @@ class LoginScreen extends React.Component<PropsType, StateType> {
hideMascotDialog = () => { hideMascotDialog = () => {
AsyncStorageManager.set( AsyncStorageManager.set(
AsyncStorageManager.PREFERENCES.loginShowBanner.key, AsyncStorageManager.PREFERENCES.loginShowMascot.key,
false, false,
); );
this.setState({mascotDialogVisible: false}); this.setState({mascotDialogVisible: false});
@ -327,7 +327,7 @@ class LoginScreen extends React.Component<PropsType, StateType> {
const {navigation} = this.props; const {navigation} = this.props;
// Do not show the home login banner again // Do not show the home login banner again
AsyncStorageManager.set( AsyncStorageManager.set(
AsyncStorageManager.PREFERENCES.homeShowBanner.key, AsyncStorageManager.PREFERENCES.homeShowMascot.key,
false, false,
); );
if (this.nextScreen == null) navigation.goBack(); if (this.nextScreen == null) navigation.goBack();

View file

@ -127,7 +127,7 @@ export default class VoteScreen extends React.Component<PropsType, StateType> {
this.state = { this.state = {
hasVoted: false, hasVoted: false,
mascotDialogVisible: AsyncStorageManager.getBool( mascotDialogVisible: AsyncStorageManager.getBool(
AsyncStorageManager.PREFERENCES.voteShowBanner.key, AsyncStorageManager.PREFERENCES.voteShowMascot.key,
), ),
}; };
this.hasVoted = false; this.hasVoted = false;
@ -309,7 +309,7 @@ export default class VoteScreen extends React.Component<PropsType, StateType> {
hideMascotDialog = () => { hideMascotDialog = () => {
AsyncStorageManager.set( AsyncStorageManager.set(
AsyncStorageManager.PREFERENCES.voteShowBanner.key, AsyncStorageManager.PREFERENCES.voteShowMascot.key,
false, false,
); );
this.setState({mascotDialogVisible: false}); this.setState({mascotDialogVisible: false});

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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