forked from Ivasoft/mattermost-mobile
Ensure reset of version and badge when logout (#832)
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user