Ensure reset of version and badge when logout (#832)
This commit is contained in:
parent
aeb3691696
commit
f7cbf3afd0
1 changed files with 14 additions and 7 deletions
|
|
@ -170,13 +170,7 @@ export default class Mattermost {
|
|||
};
|
||||
|
||||
handleReset = () => {
|
||||
const {dispatch, getState} = store;
|
||||
Client4.serverVersion = '';
|
||||
Client.serverVersion = '';
|
||||
Client.token = null;
|
||||
Client4.userId = '';
|
||||
PushNotifications.cancelAllLocalNotifications();
|
||||
setServerVersion('')(dispatch, getState);
|
||||
this.resetBadgeAndVersion();
|
||||
this.startApp('fade');
|
||||
};
|
||||
|
||||
|
|
@ -198,6 +192,8 @@ export default class Mattermost {
|
|||
InteractionManager.runAfterInteractions(() => {
|
||||
logout()(dispatch, getState);
|
||||
});
|
||||
} else {
|
||||
this.resetBadgeAndVersion();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -262,6 +258,17 @@ export default class Mattermost {
|
|||
}
|
||||
};
|
||||
|
||||
resetBadgeAndVersion = () => {
|
||||
const {dispatch, getState} = store;
|
||||
Client4.serverVersion = '';
|
||||
Client.serverVersion = '';
|
||||
Client.token = null;
|
||||
Client4.userId = '';
|
||||
PushNotifications.setApplicationIconBadgeNumber(0);
|
||||
PushNotifications.cancelAllLocalNotifications();
|
||||
setServerVersion('')(dispatch, getState);
|
||||
};
|
||||
|
||||
restartApp = () => {
|
||||
Navigation.dismissModal({animationType: 'none'});
|
||||
this.startApp('fade');
|
||||
|
|
|
|||
Loading…
Reference in a new issue