Fix android white screen when the bridge is closed (#1027)

This commit is contained in:
enahum 2017-10-16 16:22:13 -03:00 committed by GitHub
parent 770af754b9
commit b5451ca352
2 changed files with 8 additions and 5 deletions

View file

@ -253,8 +253,7 @@ const state = {
views: {
channel: {
drafts: {},
loading: false,
tooltipVisible: false
loading: false
},
fetchCache: {},
i18n: {

View file

@ -397,10 +397,14 @@ export default class Mattermost {
if (Platform.OS === 'android') {
// In case of Android we need to handle the bridge being initialized by HeadlessJS
Promise.resolve(Navigation.isAppLaunched()).then((appLaunched) => {
if (appLaunched) {
this.launchApp(); // App is launched -> show UI
if (notification) {
if (appLaunched) {
this.launchApp(); // App is launched -> show UI
} else {
new NativeEventsReceiver().appLaunched(this.launchApp); // App hasn't been launched yet -> show the UI only when needed.
}
} else {
new NativeEventsReceiver().appLaunched(this.launchApp); // App hasn't been launched yet -> show the UI only when needed.
this.launchApp();
}
});
} else if (AppState.currentState === 'background') {