From b5451ca352e1ab5d01621bac00c8a1b8b56ce29b Mon Sep 17 00:00:00 2001 From: enahum Date: Mon, 16 Oct 2017 16:22:13 -0300 Subject: [PATCH] Fix android white screen when the bridge is closed (#1027) --- app/initial_state.js | 3 +-- app/mattermost.js | 10 +++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/initial_state.js b/app/initial_state.js index 9e57b2905..d33e30f73 100644 --- a/app/initial_state.js +++ b/app/initial_state.js @@ -253,8 +253,7 @@ const state = { views: { channel: { drafts: {}, - loading: false, - tooltipVisible: false + loading: false }, fetchCache: {}, i18n: { diff --git a/app/mattermost.js b/app/mattermost.js index 3adbb7eb3..9a2c5e2ac 100644 --- a/app/mattermost.js +++ b/app/mattermost.js @@ -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') {