From 2951245d6802ab8b79ed014d27586df5664665cf Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Mon, 13 Jan 2020 22:46:27 -0300 Subject: [PATCH] MM-21288 Fix attaching files on Android (#3805) --- android/app/src/main/AndroidManifest.xml | 6 +++--- app/mattermost.js | 9 +-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 57aa6aee2..70664b320 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -29,8 +29,7 @@ android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" - android:windowSoftInputMode="adjustResize" - android:launchMode="singleInstance"> + android:windowSoftInputMode="adjustResize"> @@ -60,7 +59,8 @@ android:label="@string/app_name" android:screenOrientation="portrait" android:theme="@style/AppTheme" - android:taskAffinity="com.mattermost.share"> + android:taskAffinity="com.mattermost.share" + android:launchMode="singleInstance"> diff --git a/app/mattermost.js b/app/mattermost.js index f89a654e0..c82c1b36d 100644 --- a/app/mattermost.js +++ b/app/mattermost.js @@ -1,7 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. -import {Linking, NativeModules, Platform} from 'react-native'; +import {Linking} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {Provider} from 'react-redux'; @@ -21,9 +21,6 @@ import EphemeralStore from 'app/store/ephemeral_store'; import telemetry from 'app/telemetry'; import pushNotificationsUtils from 'app/utils/push_notifications'; -const {MattermostShare} = NativeModules; -const sharedExtensionStarted = Platform.OS === 'android' && MattermostShare.isOpened; - const init = async () => { const credentials = await getAppCredentials(); if (EphemeralStore.appStarted) { @@ -39,10 +36,6 @@ const init = async () => { registerScreens(store, Provider); - if (sharedExtensionStarted) { - EphemeralStore.appStarted = true; - } - if (!EphemeralStore.appStarted) { launchAppAndAuthenticateIfNeeded(credentials); }