forked from Ivasoft/mattermost-mobile
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e08d69b10 | ||
|
|
a8a95a98e7 | ||
|
|
b4b23d4d46 | ||
|
|
99cff03193 | ||
|
|
b9864bf26f | ||
|
|
e73b9017fc |
1
Makefile
1
Makefile
@@ -76,6 +76,7 @@ post-install:
|
|||||||
@sed -i'' -e 's|"./locale-data/complete.js": false|"./locale-data/complete.js": "./locale-data/complete.js"|g' node_modules/intl/package.json
|
@sed -i'' -e 's|"./locale-data/complete.js": false|"./locale-data/complete.js": "./locale-data/complete.js"|g' node_modules/intl/package.json
|
||||||
@sed -i'' -e 's|auto("auto", Configuration.ORIENTATION_UNDEFINED, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);|auto("auto", Configuration.ORIENTATION_UNDEFINED, ActivityInfo.SCREEN_ORIENTATION_FULL_USER);|g' node_modules/react-native-navigation/android/app/src/main/java/com/reactnativenavigation/params/Orientation.java
|
@sed -i'' -e 's|auto("auto", Configuration.ORIENTATION_UNDEFINED, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);|auto("auto", Configuration.ORIENTATION_UNDEFINED, ActivityInfo.SCREEN_ORIENTATION_FULL_USER);|g' node_modules/react-native-navigation/android/app/src/main/java/com/reactnativenavigation/params/Orientation.java
|
||||||
@sed -i'' -e "s|var AndroidTextInput = requireNativeComponent('AndroidTextInput', null);|var AndroidTextInput = requireNativeComponent('CustomTextInput', null);|g" node_modules/react-native/Libraries/Components/TextInput/TextInput.js
|
@sed -i'' -e "s|var AndroidTextInput = requireNativeComponent('AndroidTextInput', null);|var AndroidTextInput = requireNativeComponent('CustomTextInput', null);|g" node_modules/react-native/Libraries/Components/TextInput/TextInput.js
|
||||||
|
@sed -i'' -e "s|super.onBackPressed();|this.moveTaskToBack(true);|g" node_modules/react-native-navigation/android/app/src/main/java/com/reactnativenavigation/controllers/NavigationActivity.java
|
||||||
@if [ $(shell grep "const Platform" node_modules/react-native/Libraries/Lists/VirtualizedList.js | grep -civ grep) -eq 0 ]; then \
|
@if [ $(shell grep "const Platform" node_modules/react-native/Libraries/Lists/VirtualizedList.js | grep -civ grep) -eq 0 ]; then \
|
||||||
sed $ -i'' -e "s|const ReactNative = require('ReactNative');|const ReactNative = require('ReactNative');`echo $\\\\\\r;`const Platform = require('Platform');|g" node_modules/react-native/Libraries/Lists/VirtualizedList.js; \
|
sed $ -i'' -e "s|const ReactNative = require('ReactNative');|const ReactNative = require('ReactNative');`echo $\\\\\\r;`const Platform = require('Platform');|g" node_modules/react-native/Libraries/Lists/VirtualizedList.js; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ android {
|
|||||||
applicationId "com.mattermost.rnbeta"
|
applicationId "com.mattermost.rnbeta"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 23
|
targetSdkVersion 23
|
||||||
versionCode 85
|
versionCode 86
|
||||||
versionName "1.6.0"
|
versionName "1.6.1"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "x86"
|
abiFilters "armeabi-v7a", "x86"
|
||||||
|
|||||||
@@ -1,10 +1,31 @@
|
|||||||
package com.mattermost.rnbeta;
|
package com.mattermost.rnbeta;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
import com.reactnativenavigation.controllers.SplashActivity;
|
import com.reactnativenavigation.controllers.SplashActivity;
|
||||||
|
|
||||||
public class MainActivity extends SplashActivity {
|
public class MainActivity extends SplashActivity {
|
||||||
@Override
|
@Override
|
||||||
public int getSplashLayout() {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
return R.layout.launch_screen;
|
super.onCreate(savedInstanceState);
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* Reference: https://stackoverflow.com/questions/7944338/resume-last-activity-when-launcher-icon-is-clicked
|
||||||
|
* 1. Open app from launcher/appDrawer
|
||||||
|
* 2. Go home
|
||||||
|
* 3. Send notification and open
|
||||||
|
* 4. It creates a new Activity and Destroys the old
|
||||||
|
* 5. Causing an unnecessary app restart
|
||||||
|
* 6. This solution short-circuits the restart
|
||||||
|
*/
|
||||||
|
if (!isTaskRoot()) {
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSplashLayout() {
|
||||||
|
return R.layout.launch_screen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,13 @@ public class MainApplication extends NavigationApplication implements INotificat
|
|||||||
SoLoader.init(this, /* native exopackage */ false);
|
SoLoader.init(this, /* native exopackage */ false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean clearHostOnActivityDestroy() {
|
||||||
|
// This solves the issue where the splash screen does not go away
|
||||||
|
// after the app is killed by the OS cause of memory or a long time in the background
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPushNotification getPushNotification(Context context, Bundle bundle, AppLifecycleFacade defaultFacade, AppLaunchHelper defaultAppLaunchHelper) {
|
public IPushNotification getPushNotification(Context context, Bundle bundle, AppLifecycleFacade defaultFacade, AppLaunchHelper defaultAppLaunchHelper) {
|
||||||
return new CustomPushNotification(
|
return new CustomPushNotification(
|
||||||
|
|||||||
@@ -39,12 +39,11 @@ public class NotificationsLifecycleFacade extends ActivityCallbacks implements A
|
|||||||
|
|
||||||
private final BroadcastReceiver restrictionsReceiver = new BroadcastReceiver() {
|
private final BroadcastReceiver restrictionsReceiver = new BroadcastReceiver() {
|
||||||
@Override public void onReceive(Context context, Intent intent) {
|
@Override public void onReceive(Context context, Intent intent) {
|
||||||
|
if (context != null) {
|
||||||
if (mVisibleActivity != null) {
|
|
||||||
// Get the current configuration bundle
|
// Get the current configuration bundle
|
||||||
RestrictionsManager myRestrictionsMgr =
|
RestrictionsManager myRestrictionsMgr =
|
||||||
(RestrictionsManager) mVisibleActivity
|
(RestrictionsManager) context
|
||||||
.getSystemService(Context.RESTRICTIONS_SERVICE);
|
.getSystemService(Context.RESTRICTIONS_SERVICE);
|
||||||
managedConfig = myRestrictionsMgr.getApplicationRestrictions();
|
managedConfig = myRestrictionsMgr.getApplicationRestrictions();
|
||||||
|
|
||||||
// Check current configuration settings, change your app's UI and
|
// Check current configuration settings, change your app's UI and
|
||||||
@@ -66,11 +65,11 @@ public class NotificationsLifecycleFacade extends ActivityCallbacks implements A
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||||
MattermostManagedModule managedModule = MattermostManagedModule.getInstance();
|
MattermostManagedModule managedModule = MattermostManagedModule.getInstance();
|
||||||
if (managedModule != null && managedModule.isBlurAppScreenEnabled()) {
|
if (managedModule != null && managedModule.isBlurAppScreenEnabled() && activity != null) {
|
||||||
activity.getWindow().setFlags(LayoutParams.FLAG_SECURE,
|
activity.getWindow().setFlags(LayoutParams.FLAG_SECURE,
|
||||||
LayoutParams.FLAG_SECURE);
|
LayoutParams.FLAG_SECURE);
|
||||||
}
|
}
|
||||||
if (managedConfig!= null && managedConfig.size() > 0) {
|
if (managedConfig!= null && managedConfig.size() > 0 && activity != null) {
|
||||||
activity.registerReceiver(restrictionsReceiver, restrictionsFilter);
|
activity.registerReceiver(restrictionsReceiver, restrictionsFilter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -79,9 +78,11 @@ public class NotificationsLifecycleFacade extends ActivityCallbacks implements A
|
|||||||
public void onActivityResumed(Activity activity) {
|
public void onActivityResumed(Activity activity) {
|
||||||
switchToVisible(activity);
|
switchToVisible(activity);
|
||||||
|
|
||||||
if (managedConfig != null && managedConfig.size() > 0) {
|
ReactContext ctx = getRunningReactContext();
|
||||||
|
if (managedConfig != null && managedConfig.size() > 0 && ctx != null) {
|
||||||
|
|
||||||
RestrictionsManager myRestrictionsMgr =
|
RestrictionsManager myRestrictionsMgr =
|
||||||
(RestrictionsManager) activity
|
(RestrictionsManager) ctx
|
||||||
.getSystemService(Context.RESTRICTIONS_SERVICE);
|
.getSystemService(Context.RESTRICTIONS_SERVICE);
|
||||||
|
|
||||||
Bundle newConfig = myRestrictionsMgr.getApplicationRestrictions();
|
Bundle newConfig = myRestrictionsMgr.getApplicationRestrictions();
|
||||||
@@ -174,13 +175,15 @@ public class NotificationsLifecycleFacade extends ActivityCallbacks implements A
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void LoadManagedConfig(Activity activity) {
|
public synchronized void LoadManagedConfig(ReactContext ctx) {
|
||||||
RestrictionsManager myRestrictionsMgr =
|
if (ctx != null) {
|
||||||
(RestrictionsManager) activity
|
RestrictionsManager myRestrictionsMgr =
|
||||||
.getSystemService(Context.RESTRICTIONS_SERVICE);
|
(RestrictionsManager) ctx
|
||||||
|
.getSystemService(Context.RESTRICTIONS_SERVICE);
|
||||||
|
|
||||||
managedConfig = myRestrictionsMgr.getApplicationRestrictions();
|
managedConfig = myRestrictionsMgr.getApplicationRestrictions();
|
||||||
myRestrictionsMgr = null;
|
myRestrictionsMgr = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized Bundle getManagedConfig() {
|
public synchronized Bundle getManagedConfig() {
|
||||||
@@ -188,8 +191,10 @@ public class NotificationsLifecycleFacade extends ActivityCallbacks implements A
|
|||||||
return managedConfig;
|
return managedConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mVisibleActivity != null) {
|
ReactContext ctx = getRunningReactContext();
|
||||||
LoadManagedConfig(mVisibleActivity);
|
|
||||||
|
if (ctx != null) {
|
||||||
|
LoadManagedConfig(ctx);
|
||||||
return managedConfig;
|
return managedConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,9 +203,11 @@ public class NotificationsLifecycleFacade extends ActivityCallbacks implements A
|
|||||||
|
|
||||||
public void sendConfigChanged(Bundle config) {
|
public void sendConfigChanged(Bundle config) {
|
||||||
Object result = Arguments.fromBundle(config);
|
Object result = Arguments.fromBundle(config);
|
||||||
getRunningReactContext().
|
ReactContext ctx = getRunningReactContext();
|
||||||
getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).
|
if (ctx != null) {
|
||||||
emit("managedConfigDidChange", result);
|
ctx.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).
|
||||||
|
emit("managedConfigDidChange", result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean equalBundles(Bundle one, Bundle two) {
|
private boolean equalBundles(Bundle one, Bundle two) {
|
||||||
|
|||||||
@@ -460,7 +460,8 @@ export function increasePostVisibility(channelId, focusedPostId) {
|
|||||||
|
|
||||||
// Check if we already have the posts that we want to show
|
// Check if we already have the posts that we want to show
|
||||||
if (!focusedPostId) {
|
if (!focusedPostId) {
|
||||||
const loadedPostCount = state.entities.posts.postsInChannel[channelId].length;
|
const postsInChannel = state.entities.posts.postsInChannel[channelId] || [];
|
||||||
|
const loadedPostCount = postsInChannel.length;
|
||||||
const desiredPostVisibility = currentPostVisibility + ViewTypes.POST_VISIBILITY_CHUNK_SIZE;
|
const desiredPostVisibility = currentPostVisibility + ViewTypes.POST_VISIBILITY_CHUNK_SIZE;
|
||||||
|
|
||||||
if (loadedPostCount >= desiredPostVisibility) {
|
if (loadedPostCount >= desiredPostVisibility) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import {getDataRetentionPolicy} from 'mattermost-redux/actions/general';
|
import {getDataRetentionPolicy} from 'mattermost-redux/actions/general';
|
||||||
import {GeneralTypes} from 'mattermost-redux/action_types';
|
import {GeneralTypes} from 'mattermost-redux/action_types';
|
||||||
import {Client, Client4} from 'mattermost-redux/client';
|
import {Client4} from 'mattermost-redux/client';
|
||||||
|
|
||||||
import {ViewTypes} from 'app/constants';
|
import {ViewTypes} from 'app/constants';
|
||||||
|
|
||||||
@@ -39,9 +39,6 @@ export function handleSuccessfulLogin() {
|
|||||||
}
|
}
|
||||||
}, getState);
|
}, getState);
|
||||||
|
|
||||||
Client.setToken(token);
|
|
||||||
Client.setUrl(url);
|
|
||||||
|
|
||||||
if (config.DataRetentionEnableMessageDeletion && config.DataRetentionEnableMessageDeletion === 'true' &&
|
if (config.DataRetentionEnableMessageDeletion && config.DataRetentionEnableMessageDeletion === 'true' &&
|
||||||
license.IsLicensed === 'true' && license.DataRetention === 'true') {
|
license.IsLicensed === 'true' && license.DataRetention === 'true') {
|
||||||
getDataRetentionPolicy()(dispatch, getState);
|
getDataRetentionPolicy()(dispatch, getState);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
|
|
||||||
import {Client, Client4} from 'mattermost-redux/client';
|
import {Client4} from 'mattermost-redux/client';
|
||||||
import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels';
|
import {getCurrentChannelId} from 'mattermost-redux/selectors/entities/channels';
|
||||||
import {getCurrentUrl} from 'mattermost-redux/selectors/entities/general';
|
import {getCurrentUrl} from 'mattermost-redux/selectors/entities/general';
|
||||||
|
|
||||||
@@ -15,7 +15,6 @@ import Root from './root';
|
|||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
const locale = getCurrentLocale(state);
|
const locale = getCurrentLocale(state);
|
||||||
Client.setLocale(locale);
|
|
||||||
Client4.setAcceptLanguage(locale);
|
Client4.setAcceptLanguage(locale);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -66,9 +66,15 @@ export default class SearchBarAndroid extends PureComponent {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
|
value: props.value,
|
||||||
isFocused: false
|
isFocused: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
componentWillReceiveProps(nextProps) {
|
||||||
|
if (this.state.value !== nextProps.value) {
|
||||||
|
this.setState({value: nextProps.value});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cancel = () => {
|
cancel = () => {
|
||||||
this.onCancelButtonPress();
|
this.onCancelButtonPress();
|
||||||
@@ -102,7 +108,9 @@ export default class SearchBarAndroid extends PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onChangeText = (value) => {
|
onChangeText = (value) => {
|
||||||
this.props.onChangeText(value);
|
this.setState({value}, () => {
|
||||||
|
this.props.onChangeText(value);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onSelectionChange = (event) => {
|
onSelectionChange = (event) => {
|
||||||
@@ -196,7 +204,7 @@ export default class SearchBarAndroid extends PureComponent {
|
|||||||
<TextInput
|
<TextInput
|
||||||
ref='input'
|
ref='input'
|
||||||
blurOnSubmit={blurOnSubmit}
|
blurOnSubmit={blurOnSubmit}
|
||||||
value={value}
|
value={this.state.value}
|
||||||
autoCapitalize={autoCapitalize}
|
autoCapitalize={autoCapitalize}
|
||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
returnKeyType={returnKeyType || 'search'}
|
returnKeyType={returnKeyType || 'search'}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ import {General} from 'mattermost-redux/constants';
|
|||||||
import {setAppState, setDeviceToken, setServerVersion} from 'mattermost-redux/actions/general';
|
import {setAppState, setDeviceToken, setServerVersion} from 'mattermost-redux/actions/general';
|
||||||
import {markChannelAsRead} from 'mattermost-redux/actions/channels';
|
import {markChannelAsRead} from 'mattermost-redux/actions/channels';
|
||||||
import {logError} from 'mattermost-redux/actions/errors';
|
import {logError} from 'mattermost-redux/actions/errors';
|
||||||
import {logout} from 'mattermost-redux/actions/users';
|
import {loadMe, logout} from 'mattermost-redux/actions/users';
|
||||||
import {close as closeWebSocket} from 'mattermost-redux/actions/websocket';
|
import {close as closeWebSocket} from 'mattermost-redux/actions/websocket';
|
||||||
import {Client, Client4} from 'mattermost-redux/client';
|
import {Client4} from 'mattermost-redux/client';
|
||||||
import EventEmitter from 'mattermost-redux/utils/event_emitter';
|
import EventEmitter from 'mattermost-redux/utils/event_emitter';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -52,58 +52,41 @@ import configureStore from 'app/store';
|
|||||||
import mattermostManaged from 'app/mattermost_managed';
|
import mattermostManaged from 'app/mattermost_managed';
|
||||||
import {deleteFileCache} from 'app/utils/file';
|
import {deleteFileCache} from 'app/utils/file';
|
||||||
import {init as initAnalytics} from 'app/utils/segment';
|
import {init as initAnalytics} from 'app/utils/segment';
|
||||||
import {
|
import {captureException, initializeSentry, LOGGER_JAVASCRIPT, LOGGER_NATIVE} from 'app/utils/sentry';
|
||||||
captureException,
|
import tracker from 'app/utils/time_tracker';
|
||||||
initializeSentry,
|
|
||||||
LOGGER_JAVASCRIPT,
|
|
||||||
LOGGER_NATIVE
|
|
||||||
} from 'app/utils/sentry';
|
|
||||||
import {stripTrailingSlashes} from 'app/utils/url';
|
import {stripTrailingSlashes} from 'app/utils/url';
|
||||||
|
|
||||||
import Config from 'assets/config';
|
import LocalConfig from 'assets/config';
|
||||||
|
|
||||||
const {StatusBarManager} = NativeModules;
|
const {StatusBarManager} = NativeModules;
|
||||||
const AUTHENTICATION_TIMEOUT = 5 * 60 * 1000;
|
const AUTHENTICATION_TIMEOUT = 5 * 60 * 1000;
|
||||||
|
|
||||||
export default class Mattermost {
|
export default class Mattermost {
|
||||||
constructor() {
|
constructor() {
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
// This is to remove the warnings for the scaleY property used in android.
|
|
||||||
// The property is necessary because some Android devices won't render the posts
|
|
||||||
// properly if we use transform: {scaleY: -1} in the stylesheet.
|
|
||||||
console.ignoredYellowBox = ['`scaleY`']; //eslint-disable-line
|
|
||||||
}
|
|
||||||
this.isConfigured = false;
|
this.isConfigured = false;
|
||||||
this.allowOtherServers = true;
|
this.allowOtherServers = true;
|
||||||
|
this.startAppFromPushNotification = false;
|
||||||
|
this.emmEnabled = false;
|
||||||
|
|
||||||
|
Client4.setUserAgent(DeviceInfo.getUserAgent());
|
||||||
Orientation.unlockAllOrientations();
|
Orientation.unlockAllOrientations();
|
||||||
|
|
||||||
initializeSentry();
|
initializeSentry();
|
||||||
|
|
||||||
this.store = configureStore(initialState);
|
this.store = configureStore(initialState);
|
||||||
|
registerScreens(this.store, Provider);
|
||||||
|
|
||||||
this.unsubscribeFromStore = this.store.subscribe(this.listenForHydration);
|
this.unsubscribeFromStore = this.store.subscribe(this.listenForHydration);
|
||||||
AppState.addEventListener('change', this.handleAppStateChange);
|
AppState.addEventListener('change', this.handleAppStateChange);
|
||||||
EventEmitter.on(General.CONFIG_CHANGED, this.handleConfigChanged);
|
EventEmitter.on(General.CONFIG_CHANGED, this.handleServerConfigChanged);
|
||||||
EventEmitter.on(NavigationTypes.NAVIGATION_RESET, this.handleReset);
|
EventEmitter.on(NavigationTypes.NAVIGATION_RESET, this.handleLogout);
|
||||||
EventEmitter.on(General.DEFAULT_CHANNEL, this.handleResetDisplayName);
|
EventEmitter.on(General.DEFAULT_CHANNEL, this.handleResetChannelDisplayName);
|
||||||
EventEmitter.on(NavigationTypes.RESTART_APP, this.restartApp);
|
EventEmitter.on(NavigationTypes.RESTART_APP, this.restartApp);
|
||||||
Orientation.addOrientationListener(this.orientationDidChange);
|
Orientation.addOrientationListener(this.orientationDidChange);
|
||||||
mattermostManaged.addEventListener('managedConfigDidChange', this.handleManagedConfig);
|
mattermostManaged.addEventListener('managedConfigDidChange', this.handleManagedConfig);
|
||||||
|
|
||||||
this.handleAppStateChange(AppState.currentState);
|
|
||||||
Client4.setUserAgent(DeviceInfo.getUserAgent());
|
|
||||||
|
|
||||||
if (Platform.OS === 'ios') {
|
if (Platform.OS === 'ios') {
|
||||||
StatusBarSizeIOS.addEventListener('willChange', this.handleStatusBarHeightChange);
|
StatusBarSizeIOS.addEventListener('willChange', this.handleStatusBarHeightChange);
|
||||||
StatusBarManager.getHeight(
|
|
||||||
(data) => {
|
|
||||||
this.handleStatusBarHeightChange(data.height);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
registerScreens(this.store, Provider);
|
|
||||||
|
|
||||||
setJSExceptionHandler(this.errorHandler, false);
|
setJSExceptionHandler(this.errorHandler, false);
|
||||||
setNativeExceptionHandler(this.nativeErrorHandler, false);
|
setNativeExceptionHandler(this.nativeErrorHandler, false);
|
||||||
}
|
}
|
||||||
@@ -114,7 +97,10 @@ export default class Mattermost {
|
|||||||
|
|
||||||
const intl = this.getIntl();
|
const intl = this.getIntl();
|
||||||
closeWebSocket()(this.store.dispatch, this.store.getState);
|
closeWebSocket()(this.store.dispatch, this.store.getState);
|
||||||
logError(e)(this.store.dispatch);
|
|
||||||
|
if (Client4.getUrl()) {
|
||||||
|
logError(e)(this.store.dispatch);
|
||||||
|
}
|
||||||
|
|
||||||
if (isFatal) {
|
if (isFatal) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
@@ -150,7 +136,7 @@ export default class Mattermost {
|
|||||||
};
|
};
|
||||||
|
|
||||||
configureAnalytics = (config) => {
|
configureAnalytics = (config) => {
|
||||||
if (config && config.DiagnosticsEnabled === 'true' && config.DiagnosticId && Config.SegmentApiKey) {
|
if (config && config.DiagnosticsEnabled === 'true' && config.DiagnosticId && LocalConfig.SegmentApiKey) {
|
||||||
initAnalytics(config);
|
initAnalytics(config);
|
||||||
} else {
|
} else {
|
||||||
global.analytics = null;
|
global.analytics = null;
|
||||||
@@ -171,37 +157,39 @@ export default class Mattermost {
|
|||||||
handleAppStateChange = async (appState) => {
|
handleAppStateChange = async (appState) => {
|
||||||
const {dispatch, getState} = this.store;
|
const {dispatch, getState} = this.store;
|
||||||
const isActive = appState === 'active';
|
const isActive = appState === 'active';
|
||||||
|
|
||||||
setAppState(isActive)(dispatch, getState);
|
setAppState(isActive)(dispatch, getState);
|
||||||
|
|
||||||
if (isActive && this.shouldRelaunchonActive) {
|
if (isActive && this.shouldRelaunchWhenActive) {
|
||||||
|
// This handles when the app was started in the background
|
||||||
|
// cause of an iOS push notification reply
|
||||||
this.launchApp();
|
this.launchApp();
|
||||||
this.shouldRelaunchonActive = false;
|
this.shouldRelaunchWhenActive = false;
|
||||||
} else {
|
} else if (!isActive && !this.inBackgroundSince) {
|
||||||
|
// When the app is sent to the background we set the time when that happens
|
||||||
|
// and perform a data clean up to improve on performance
|
||||||
|
this.inBackgroundSince = Date.now();
|
||||||
|
dispatch({type: ViewTypes.DATA_CLEANUP, payload: getState()});
|
||||||
|
} else if (isActive && this.inBackgroundSince && (Date.now() - this.inBackgroundSince) >= AUTHENTICATION_TIMEOUT && this.emmEnabled) {
|
||||||
|
// Once the app becomes active after more than 5 minutes in the background and is controlled by an EMM
|
||||||
try {
|
try {
|
||||||
if (!isActive && !this.inBackgroundSince) {
|
const config = await mattermostManaged.getConfig();
|
||||||
this.inBackgroundSince = Date.now();
|
const authNeeded = config.inAppPinCode && config.inAppPinCode === 'true';
|
||||||
dispatch({type: ViewTypes.DATA_CLEANUP, payload: getState()});
|
if (authNeeded) {
|
||||||
} else if (isActive && this.inBackgroundSince && (Date.now() - this.inBackgroundSince) >= AUTHENTICATION_TIMEOUT) {
|
const authenticated = await this.handleAuthentication(config.vendor);
|
||||||
this.inBackgroundSince = null;
|
if (!authenticated) {
|
||||||
|
mattermostManaged.quitApp();
|
||||||
if (this.mdmEnabled) {
|
|
||||||
const config = await mattermostManaged.getConfig();
|
|
||||||
const authNeeded = config.inAppPinCode && config.inAppPinCode === 'true';
|
|
||||||
if (authNeeded) {
|
|
||||||
const authenticated = await this.handleAuthentication(config.vendor);
|
|
||||||
if (!authenticated) {
|
|
||||||
mattermostManaged.quitApp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (isActive) {
|
|
||||||
this.inBackgroundSince = null;
|
|
||||||
Keyboard.dismiss();
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isActive) {
|
||||||
|
this.inBackgroundSince = null;
|
||||||
|
Keyboard.dismiss();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
handleAuthentication = async (vendor) => {
|
handleAuthentication = async (vendor) => {
|
||||||
@@ -227,20 +215,20 @@ export default class Mattermost {
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
handleConfigChanged = async (serverVersion) => {
|
handleServerConfigChanged = async (serverVersion) => {
|
||||||
const {dispatch, getState} = this.store;
|
const {dispatch, getState} = this.store;
|
||||||
const version = serverVersion.match(/^[0-9]*.[0-9]*.[0-9]*(-[a-zA-Z0-9.-]*)?/g)[0];
|
const version = serverVersion.match(/^[0-9]*.[0-9]*.[0-9]*(-[a-zA-Z0-9.-]*)?/g)[0];
|
||||||
const intl = this.getIntl();
|
const intl = this.getIntl();
|
||||||
const state = getState();
|
const state = getState();
|
||||||
|
|
||||||
if (serverVersion) {
|
if (serverVersion) {
|
||||||
if (semver.valid(version) && semver.lt(version, Config.MinServerVersion)) {
|
if (semver.valid(version) && semver.lt(version, LocalConfig.MinServerVersion)) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
intl.formatMessage({id: 'mobile.server_upgrade.title', defaultMessage: 'Server upgrade required'}),
|
intl.formatMessage({id: 'mobile.server_upgrade.title', defaultMessage: 'Server upgrade required'}),
|
||||||
intl.formatMessage({id: 'mobile.server_upgrade.description', defaultMessage: '\nA server upgrade is required to use the Mattermost app. Please ask your System Administrator for details.\n'}),
|
intl.formatMessage({id: 'mobile.server_upgrade.description', defaultMessage: '\nA server upgrade is required to use the Mattermost app. Please ask your System Administrator for details.\n'}),
|
||||||
[{
|
[{
|
||||||
text: intl.formatMessage({id: 'mobile.server_upgrade.button', defaultMessage: 'OK'}),
|
text: intl.formatMessage({id: 'mobile.server_upgrade.button', defaultMessage: 'OK'}),
|
||||||
onPress: this.handleVersionUpgrade
|
onPress: this.handleServerVersionUpgradeNeeded
|
||||||
}],
|
}],
|
||||||
{cancelable: false}
|
{cancelable: false}
|
||||||
);
|
);
|
||||||
@@ -263,15 +251,15 @@ export default class Mattermost {
|
|||||||
let serverUrl = null;
|
let serverUrl = null;
|
||||||
let username = null;
|
let username = null;
|
||||||
|
|
||||||
if (Config.AutoSelectServerUrl) {
|
if (LocalConfig.AutoSelectServerUrl) {
|
||||||
handleServerUrlChanged(Config.DefaultServerUrl)(dispatch, getState);
|
handleServerUrlChanged(LocalConfig.DefaultServerUrl)(dispatch, getState);
|
||||||
this.allowOtherServers = false;
|
this.allowOtherServers = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const config = await mattermostManaged.getConfig();
|
const config = await mattermostManaged.getConfig();
|
||||||
if (config) {
|
if (config && Object.keys(config).length) {
|
||||||
this.mdmEnabled = true;
|
this.emmEnabled = true;
|
||||||
authNeeded = config.inAppPinCode && config.inAppPinCode === 'true';
|
authNeeded = config.inAppPinCode && config.inAppPinCode === 'true';
|
||||||
blurApplicationScreen = config.blurApplicationScreen && config.blurApplicationScreen === 'true';
|
blurApplicationScreen = config.blurApplicationScreen && config.blurApplicationScreen === 'true';
|
||||||
jailbreakProtection = config.jailbreakProtection && config.jailbreakProtection === 'true';
|
jailbreakProtection = config.jailbreakProtection && config.jailbreakProtection === 'true';
|
||||||
@@ -285,74 +273,72 @@ export default class Mattermost {
|
|||||||
this.allowOtherServers = false;
|
this.allowOtherServers = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (jailbreakProtection) {
|
||||||
|
const isTrusted = mattermostManaged.isTrustedDevice();
|
||||||
|
|
||||||
|
if (!isTrusted) {
|
||||||
|
const intl = this.getIntl();
|
||||||
|
Alert.alert(
|
||||||
|
intl.formatMessage({
|
||||||
|
id: 'mobile.managed.blocked_by',
|
||||||
|
defaultMessage: 'Blocked by {vendor}'
|
||||||
|
}, {vendor}),
|
||||||
|
intl.formatMessage({
|
||||||
|
id: 'mobile.managed.jailbreak',
|
||||||
|
defaultMessage: 'Jailbroken devices are not trusted by {vendor}, please exit the app.'
|
||||||
|
}, {vendor}),
|
||||||
|
[{
|
||||||
|
text: intl.formatMessage({id: 'mobile.managed.exit', defaultMessage: 'Exit'}),
|
||||||
|
style: 'destructive',
|
||||||
|
onPress: () => {
|
||||||
|
mattermostManaged.quitApp();
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
{cancelable: false}
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authNeeded && !serverConfig) {
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
//Start a fake app as we need at least one activity for android
|
||||||
|
await this.startFakeApp();
|
||||||
|
}
|
||||||
|
const authenticated = await this.handleAuthentication(vendor);
|
||||||
|
if (!authenticated) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (blurApplicationScreen) {
|
||||||
|
mattermostManaged.blurAppScreen(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (serverUrl) {
|
||||||
|
handleServerUrlChanged(serverUrl)(dispatch, getState);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (username) {
|
||||||
|
handleLoginIdChanged(username)(dispatch, getState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mdmEnabled) {
|
|
||||||
if (jailbreakProtection) {
|
|
||||||
const isTrusted = mattermostManaged.isTrustedDevice();
|
|
||||||
|
|
||||||
if (!isTrusted) {
|
|
||||||
const intl = this.getIntl();
|
|
||||||
Alert.alert(
|
|
||||||
intl.formatMessage({
|
|
||||||
id: 'mobile.managed.blocked_by',
|
|
||||||
defaultMessage: 'Blocked by {vendor}'
|
|
||||||
}, {vendor}),
|
|
||||||
intl.formatMessage({
|
|
||||||
id: 'mobile.managed.jailbreak',
|
|
||||||
defaultMessage: 'Jailbroken devices are not trusted by {vendor}, please exit the app.'
|
|
||||||
}, {vendor}),
|
|
||||||
[{
|
|
||||||
text: intl.formatMessage({id: 'mobile.managed.exit', defaultMessage: 'Exit'}),
|
|
||||||
style: 'destructive',
|
|
||||||
onPress: () => {
|
|
||||||
mattermostManaged.quitApp();
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
{cancelable: false}
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (authNeeded && !serverConfig) {
|
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
//Start a fake app as we need at least one activity for android
|
|
||||||
await this.startFakeApp();
|
|
||||||
}
|
|
||||||
const authenticated = await this.handleAuthentication(vendor);
|
|
||||||
if (!authenticated) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (blurApplicationScreen) {
|
|
||||||
mattermostManaged.blurAppScreen(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (serverUrl) {
|
|
||||||
handleServerUrlChanged(serverUrl)(dispatch, getState);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (username) {
|
|
||||||
handleLoginIdChanged(username)(dispatch, getState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
handleReset = () => {
|
handleLogout = () => {
|
||||||
this.appStarted = false;
|
this.appStarted = false;
|
||||||
deleteFileCache();
|
deleteFileCache();
|
||||||
this.resetBadgeAndVersion();
|
this.resetBadgeAndVersion();
|
||||||
this.startApp('fade');
|
this.startApp('fade');
|
||||||
};
|
};
|
||||||
|
|
||||||
handleResetDisplayName = (displayName) => {
|
handleResetChannelDisplayName = (displayName) => {
|
||||||
this.store.dispatch(setChannelDisplayName(displayName));
|
this.store.dispatch(setChannelDisplayName(displayName));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -360,48 +346,65 @@ export default class Mattermost {
|
|||||||
this.store.dispatch(setStatusBarHeight(nextStatusBarHeight));
|
this.store.dispatch(setStatusBarHeight(nextStatusBarHeight));
|
||||||
};
|
};
|
||||||
|
|
||||||
handleVersionUpgrade = async () => {
|
handleServerVersionUpgradeNeeded = async () => {
|
||||||
const {dispatch, getState} = this.store;
|
const {dispatch, getState} = this.store;
|
||||||
|
|
||||||
Client4.serverVersion = '';
|
this.resetBadgeAndVersion();
|
||||||
PushNotifications.setApplicationIconBadgeNumber(0);
|
|
||||||
|
|
||||||
if (getState().entities.general.credentials.token) {
|
if (getState().entities.general.credentials.token) {
|
||||||
InteractionManager.runAfterInteractions(() => {
|
InteractionManager.runAfterInteractions(() => {
|
||||||
logout()(dispatch, getState);
|
logout()(dispatch, getState);
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this.resetBadgeAndVersion();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// We need to wait for hydration to occur before load the router.
|
// We need to wait for hydration to occur before load the router.
|
||||||
listenForHydration = () => {
|
listenForHydration = () => {
|
||||||
const state = this.store.getState();
|
const {dispatch, getState} = this.store;
|
||||||
|
const state = getState();
|
||||||
if (!this.isConfigured) {
|
if (!this.isConfigured) {
|
||||||
this.configurePushNotifications();
|
this.configurePushNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.views.root.hydrationComplete) {
|
if (state.views.root.hydrationComplete) {
|
||||||
|
const orientation = Orientation.getInitialOrientation();
|
||||||
|
const {credentials, config} = state.entities.general;
|
||||||
|
const {currentUserId} = state.entities.users;
|
||||||
|
const isNotActive = AppState.currentState !== 'active';
|
||||||
|
const notification = PushNotifications.getNotification();
|
||||||
|
|
||||||
this.unsubscribeFromStore();
|
this.unsubscribeFromStore();
|
||||||
|
|
||||||
const orientation = Orientation.getInitialOrientation();
|
if (this.deviceToken) {
|
||||||
|
// If the deviceToken is set we need to dispatch it to the redux store
|
||||||
|
setDeviceToken(this.deviceToken)(dispatch, getState);
|
||||||
|
}
|
||||||
|
|
||||||
if (orientation) {
|
if (orientation) {
|
||||||
this.orientationDidChange(orientation);
|
this.orientationDidChange(orientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
const {config} = state.entities.general;
|
|
||||||
if (config) {
|
if (config) {
|
||||||
this.configureAnalytics(config);
|
this.configureAnalytics(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
const {currentUserId} = state.entities.users;
|
if (credentials.token && credentials.url) {
|
||||||
|
Client4.setToken(credentials.token);
|
||||||
|
Client4.setUrl(stripTrailingSlashes(credentials.url));
|
||||||
|
}
|
||||||
|
|
||||||
if (currentUserId) {
|
if (currentUserId) {
|
||||||
Client4.setUserId(currentUserId);
|
Client4.setUserId(currentUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const isNotActive = AppState.currentState !== 'active';
|
if (Platform.OS === 'ios') {
|
||||||
const notification = PushNotifications.getNotification();
|
StatusBarManager.getHeight(
|
||||||
|
(data) => {
|
||||||
|
this.handleStatusBarHeightChange(data.height);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (notification || this.replyNotificationData) {
|
if (notification || this.replyNotificationData) {
|
||||||
// If we have a notification means that the app was started cause of a reply
|
// If we have a notification means that the app was started cause of a reply
|
||||||
// and the app was not sitting in the background nor opened
|
// and the app was not sitting in the background nor opened
|
||||||
@@ -414,6 +417,10 @@ export default class Mattermost {
|
|||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
// In case of Android we need to handle the bridge being initialized by HeadlessJS
|
// In case of Android we need to handle the bridge being initialized by HeadlessJS
|
||||||
Promise.resolve(Navigation.isAppLaunched()).then((appLaunched) => {
|
Promise.resolve(Navigation.isAppLaunched()).then((appLaunched) => {
|
||||||
|
if (this.startAppFromPushNotification) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (appLaunched) {
|
if (appLaunched) {
|
||||||
this.launchApp(); // App is launched -> show UI
|
this.launchApp(); // App is launched -> show UI
|
||||||
} else {
|
} else {
|
||||||
@@ -422,7 +429,7 @@ export default class Mattermost {
|
|||||||
});
|
});
|
||||||
} else if (isNotActive) {
|
} else if (isNotActive) {
|
||||||
// for IOS replying from push notification starts the app in the background
|
// for IOS replying from push notification starts the app in the background
|
||||||
this.shouldRelaunchonActive = true;
|
this.shouldRelaunchWhenActive = true;
|
||||||
this.startFakeApp();
|
this.startFakeApp();
|
||||||
} else {
|
} else {
|
||||||
this.launchApp();
|
this.launchApp();
|
||||||
@@ -443,19 +450,23 @@ export default class Mattermost {
|
|||||||
prefix = General.PUSH_NOTIFY_ANDROID_REACT_NATIVE;
|
prefix = General.PUSH_NOTIFY_ANDROID_REACT_NATIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
setDeviceToken(`${prefix}:${data.token}`)(dispatch, getState);
|
const state = getState();
|
||||||
|
const token = `${prefix}:${data.token}`;
|
||||||
|
if (state.views.root.hydrationComplete) {
|
||||||
|
setDeviceToken(token)(dispatch, getState);
|
||||||
|
} else {
|
||||||
|
this.deviceToken = token;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onPushNotification = (deviceNotification) => {
|
onPushNotification = (deviceNotification) => {
|
||||||
const {dispatch, getState} = this.store;
|
const {dispatch, getState} = this.store;
|
||||||
const state = getState();
|
const state = getState();
|
||||||
const {token, url} = state.entities.general.credentials;
|
const {token, url} = state.entities.general.credentials;
|
||||||
let startAppFromPushNotification = false;
|
|
||||||
|
|
||||||
// mark the app as started as soon as possible
|
// mark the app as started as soon as possible
|
||||||
if (token && url && !this.appStarted) {
|
if (!this.appStarted && Platform.OS !== 'ios') {
|
||||||
this.appStarted = true;
|
this.startAppFromPushNotification = true;
|
||||||
startAppFromPushNotification = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const {data, foreground, message, userInfo, userInteraction} = deviceNotification;
|
const {data, foreground, message, userInfo, userInteraction} = deviceNotification;
|
||||||
@@ -474,18 +485,16 @@ export default class Mattermost {
|
|||||||
EventEmitter.emit(ViewTypes.NOTIFICATION_IN_APP, notification);
|
EventEmitter.emit(ViewTypes.NOTIFICATION_IN_APP, notification);
|
||||||
} else if (userInteraction && !notification.localNotification) {
|
} else if (userInteraction && !notification.localNotification) {
|
||||||
EventEmitter.emit('close_channel_drawer');
|
EventEmitter.emit('close_channel_drawer');
|
||||||
if (startAppFromPushNotification) {
|
if (this.startAppFromPushNotification) {
|
||||||
Client.setToken(token);
|
|
||||||
Client4.setToken(token);
|
Client4.setToken(token);
|
||||||
Client4.setUrl(stripTrailingSlashes(url));
|
Client4.setUrl(stripTrailingSlashes(url));
|
||||||
Client.setUrl(stripTrailingSlashes(url));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InteractionManager.runAfterInteractions(async () => {
|
InteractionManager.runAfterInteractions(async () => {
|
||||||
await loadFromPushNotification(notification)(dispatch, getState);
|
await loadFromPushNotification(notification)(dispatch, getState);
|
||||||
|
|
||||||
if (startAppFromPushNotification) {
|
if (this.startAppFromPushNotification) {
|
||||||
this.startAppFromPushNotification();
|
this.launchApp();
|
||||||
} else {
|
} else {
|
||||||
EventEmitter.emit(ViewTypes.NOTIFICATION_TAPPED);
|
EventEmitter.emit(ViewTypes.NOTIFICATION_TAPPED);
|
||||||
}
|
}
|
||||||
@@ -514,7 +523,7 @@ export default class Mattermost {
|
|||||||
Client4.setUrl(state.entities.general.credentials.url);
|
Client4.setUrl(state.entities.general.credentials.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Client.getToken()) {
|
if (!Client4.getToken()) {
|
||||||
// Make sure the Client has the server token set
|
// Make sure the Client has the server token set
|
||||||
Client4.setToken(state.entities.general.credentials.token);
|
Client4.setToken(state.entities.general.credentials.token);
|
||||||
}
|
}
|
||||||
@@ -552,9 +561,7 @@ export default class Mattermost {
|
|||||||
resetBadgeAndVersion = () => {
|
resetBadgeAndVersion = () => {
|
||||||
const {dispatch, getState} = this.store;
|
const {dispatch, getState} = this.store;
|
||||||
Client4.serverVersion = '';
|
Client4.serverVersion = '';
|
||||||
Client.serverVersion = '';
|
Client4.setUserId('');
|
||||||
Client.token = null;
|
|
||||||
Client4.userId = '';
|
|
||||||
PushNotifications.setApplicationIconBadgeNumber(0);
|
PushNotifications.setApplicationIconBadgeNumber(0);
|
||||||
PushNotifications.cancelAllLocalNotifications();
|
PushNotifications.cancelAllLocalNotifications();
|
||||||
setServerVersion('')(dispatch, getState);
|
setServerVersion('')(dispatch, getState);
|
||||||
@@ -565,6 +572,7 @@ export default class Mattermost {
|
|||||||
|
|
||||||
const {dispatch, getState} = this.store;
|
const {dispatch, getState} = this.store;
|
||||||
await loadConfigAndLicense()(dispatch, getState);
|
await loadConfigAndLicense()(dispatch, getState);
|
||||||
|
await loadMe()(dispatch, getState);
|
||||||
this.appStarted = false;
|
this.appStarted = false;
|
||||||
this.startApp('fade');
|
this.startApp('fade');
|
||||||
};
|
};
|
||||||
@@ -586,18 +594,29 @@ export default class Mattermost {
|
|||||||
statusBarHidden: false,
|
statusBarHidden: false,
|
||||||
statusBarHideWithNavBar: false
|
statusBarHideWithNavBar: false
|
||||||
}
|
}
|
||||||
},
|
|
||||||
passProps: {
|
|
||||||
justInit: true
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
startApp = (animationType = 'none') => {
|
startApp = (animationType = 'none') => {
|
||||||
if (!this.appStarted) {
|
if (!this.appStarted) {
|
||||||
|
const {dispatch, getState} = this.store;
|
||||||
|
const {entities} = getState();
|
||||||
|
let screen = 'SelectServer';
|
||||||
|
|
||||||
|
if (entities) {
|
||||||
|
const {credentials} = entities.general;
|
||||||
|
|
||||||
|
if (credentials.token && credentials.url) {
|
||||||
|
screen = 'Channel';
|
||||||
|
tracker.initialLoad = Date.now();
|
||||||
|
loadMe()(dispatch, getState);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Navigation.startSingleScreenApp({
|
Navigation.startSingleScreenApp({
|
||||||
screen: {
|
screen: {
|
||||||
screen: 'Root',
|
screen,
|
||||||
navigatorStyle: {
|
navigatorStyle: {
|
||||||
navBarHidden: true,
|
navBarHidden: true,
|
||||||
statusBarHidden: false,
|
statusBarHidden: false,
|
||||||
@@ -615,28 +634,7 @@ export default class Mattermost {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.appStarted = true;
|
this.appStarted = true;
|
||||||
|
this.startAppFromPushNotification = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
startAppFromPushNotification = () => {
|
|
||||||
Navigation.startSingleScreenApp({
|
|
||||||
screen: {
|
|
||||||
screen: 'Channel',
|
|
||||||
navigatorStyle: {
|
|
||||||
navBarHidden: true,
|
|
||||||
statusBarHidden: false,
|
|
||||||
statusBarHideWithNavBar: false,
|
|
||||||
screenBackgroundColor: 'transparent'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
passProps: {
|
|
||||||
allowOtherServers: this.allowOtherServers
|
|
||||||
},
|
|
||||||
appStyle: {
|
|
||||||
orientation: 'auto'
|
|
||||||
},
|
|
||||||
animationType: 'none'
|
|
||||||
});
|
|
||||||
this.appStarted = false;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ class Channel extends PureComponent {
|
|||||||
|
|
||||||
if (this.props.currentTeamId) {
|
if (this.props.currentTeamId) {
|
||||||
this.loadChannels(this.props.currentTeamId);
|
this.loadChannels(this.props.currentTeamId);
|
||||||
|
} else {
|
||||||
|
this.props.actions.selectFirstAvailableTeam();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ class ChannelAddMembers extends PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
searchProfiles = (text) => {
|
searchProfiles = (text) => {
|
||||||
const term = text.toLowerCase();
|
const term = text;
|
||||||
const {actions, currentChannel, currentTeam} = this.props;
|
const {actions, currentChannel, currentTeam} = this.props;
|
||||||
|
|
||||||
if (term) {
|
if (term) {
|
||||||
@@ -213,7 +213,7 @@ class ChannelAddMembers extends PureComponent {
|
|||||||
clearTimeout(this.searchTimeoutId);
|
clearTimeout(this.searchTimeoutId);
|
||||||
|
|
||||||
this.searchTimeoutId = setTimeout(() => {
|
this.searchTimeoutId = setTimeout(() => {
|
||||||
actions.searchProfiles(term, {not_in_channel_id: currentChannel.id, team_id: currentTeam.id});
|
actions.searchProfiles(term.toLowerCase(), {not_in_channel_id: currentChannel.id, team_id: currentTeam.id});
|
||||||
}, General.SEARCH_TIMEOUT_MILLISECONDS);
|
}, General.SEARCH_TIMEOUT_MILLISECONDS);
|
||||||
} else {
|
} else {
|
||||||
this.cancelSearch();
|
this.cancelSearch();
|
||||||
|
|||||||
@@ -253,14 +253,14 @@ class ChannelMembers extends PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
searchProfiles = (text) => {
|
searchProfiles = (text) => {
|
||||||
const term = text.toLowerCase();
|
const term = text;
|
||||||
|
|
||||||
if (term) {
|
if (term) {
|
||||||
this.setState({searching: true, term});
|
this.setState({searching: true, term});
|
||||||
clearTimeout(this.searchTimeoutId);
|
clearTimeout(this.searchTimeoutId);
|
||||||
|
|
||||||
this.searchTimeoutId = setTimeout(() => {
|
this.searchTimeoutId = setTimeout(() => {
|
||||||
this.props.actions.searchProfiles(term, {in_channel_id: this.props.currentChannel.id});
|
this.props.actions.searchProfiles(term.toLowerCase(), {in_channel_id: this.props.currentChannel.id});
|
||||||
}, General.SEARCH_TIMEOUT_MILLISECONDS);
|
}, General.SEARCH_TIMEOUT_MILLISECONDS);
|
||||||
} else {
|
} else {
|
||||||
this.cancelSearch();
|
this.cancelSearch();
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import EditChannel from 'app/screens/edit_channel';
|
|||||||
import EditPost from 'app/screens/edit_post';
|
import EditPost from 'app/screens/edit_post';
|
||||||
import EditProfile from 'app/screens/edit_profile';
|
import EditProfile from 'app/screens/edit_profile';
|
||||||
import ImagePreview from 'app/screens/image_preview';
|
import ImagePreview from 'app/screens/image_preview';
|
||||||
import LoadTeam from 'app/screens/load_team';
|
|
||||||
import Login from 'app/screens/login';
|
import Login from 'app/screens/login';
|
||||||
import LoginOptions from 'app/screens/login_options';
|
import LoginOptions from 'app/screens/login_options';
|
||||||
import Mfa from 'app/screens/mfa';
|
import Mfa from 'app/screens/mfa';
|
||||||
@@ -78,7 +77,6 @@ export function registerScreens(store, Provider) {
|
|||||||
Navigation.registerComponent('EditPost', () => wrapWithContextProvider(EditPost), store, Provider);
|
Navigation.registerComponent('EditPost', () => wrapWithContextProvider(EditPost), store, Provider);
|
||||||
Navigation.registerComponent('EditProfile', () => wrapWithContextProvider(EditProfile), store, Provider);
|
Navigation.registerComponent('EditProfile', () => wrapWithContextProvider(EditProfile), store, Provider);
|
||||||
Navigation.registerComponent('ImagePreview', () => wrapWithContextProvider(ImagePreview), store, Provider);
|
Navigation.registerComponent('ImagePreview', () => wrapWithContextProvider(ImagePreview), store, Provider);
|
||||||
Navigation.registerComponent('LoadTeam', () => wrapWithContextProvider(LoadTeam, false), store, Provider);
|
|
||||||
Navigation.registerComponent('Login', () => wrapWithContextProvider(Login), store, Provider);
|
Navigation.registerComponent('Login', () => wrapWithContextProvider(Login), store, Provider);
|
||||||
Navigation.registerComponent('LoginOptions', () => wrapWithContextProvider(LoginOptions), store, Provider);
|
Navigation.registerComponent('LoginOptions', () => wrapWithContextProvider(LoginOptions), store, Provider);
|
||||||
Navigation.registerComponent('MFA', () => wrapWithContextProvider(Mfa), store, Provider);
|
Navigation.registerComponent('MFA', () => wrapWithContextProvider(Mfa), store, Provider);
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
|
||||||
// See License.txt for license information.
|
|
||||||
|
|
||||||
import {bindActionCreators} from 'redux';
|
|
||||||
import {connect} from 'react-redux';
|
|
||||||
|
|
||||||
import {getTeams} from 'mattermost-redux/actions/teams';
|
|
||||||
import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams';
|
|
||||||
|
|
||||||
import {handleTeamChange} from 'app/actions/views/select_team';
|
|
||||||
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|
||||||
|
|
||||||
import LoadTeam from './load_team';
|
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
|
||||||
return {
|
|
||||||
config: state.entities.general.config,
|
|
||||||
theme: getTheme(state),
|
|
||||||
teams: state.entities.teams.teams,
|
|
||||||
currentTeam: getCurrentTeam(state),
|
|
||||||
myMembers: state.entities.teams.myMembers,
|
|
||||||
notification: state.views.notification
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function mapDispatchToProps(dispatch) {
|
|
||||||
return {
|
|
||||||
actions: bindActionCreators({
|
|
||||||
getTeams,
|
|
||||||
handleTeamChange
|
|
||||||
}, dispatch)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(LoadTeam);
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
|
||||||
// See License.txt for license information.
|
|
||||||
|
|
||||||
import {PureComponent} from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import EventEmitter from 'mattermost-redux/utils/event_emitter';
|
|
||||||
|
|
||||||
import {NavigationTypes} from 'app/constants';
|
|
||||||
|
|
||||||
export default class LoadTeam extends PureComponent {
|
|
||||||
static propTypes = {
|
|
||||||
actions: PropTypes.shape({
|
|
||||||
getTeams: PropTypes.func.isRequired,
|
|
||||||
handleTeamChange: PropTypes.func.isRequired
|
|
||||||
}).isRequired,
|
|
||||||
currentTeam: PropTypes.object,
|
|
||||||
myMembers: PropTypes.object.isRequired,
|
|
||||||
navigator: PropTypes.object,
|
|
||||||
teams: PropTypes.object.isRequired,
|
|
||||||
theme: PropTypes.object.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
const {currentTeam, myMembers, teams} = this.props;
|
|
||||||
if (currentTeam && myMembers[currentTeam.id]) {
|
|
||||||
return this.onSelectTeam(currentTeam);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.selectFirstTeam(teams, myMembers);
|
|
||||||
}
|
|
||||||
|
|
||||||
selectFirstTeam(allTeams, myMembers) {
|
|
||||||
const teams = Object.keys(myMembers).map((key) => allTeams[key]);
|
|
||||||
const firstTeam = Object.values(teams).sort((a, b) => a.display_name.localeCompare(b.display_name))[0];
|
|
||||||
|
|
||||||
if (firstTeam) {
|
|
||||||
this.onSelectTeam(firstTeam);
|
|
||||||
} else {
|
|
||||||
const {getTeams} = this.props.actions;
|
|
||||||
getTeams().then(() => {
|
|
||||||
EventEmitter.emit(NavigationTypes.NAVIGATION_NO_TEAMS);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onSelectTeam(team) {
|
|
||||||
const {handleTeamChange} = this.props.actions;
|
|
||||||
handleTeamChange(team.id).then(this.goToChannelView);
|
|
||||||
}
|
|
||||||
|
|
||||||
goToChannelView = () => {
|
|
||||||
const {navigator, theme} = this.props;
|
|
||||||
|
|
||||||
navigator.resetTo({
|
|
||||||
screen: 'Channel',
|
|
||||||
animated: true,
|
|
||||||
animationType: 'fade',
|
|
||||||
navigatorStyle: {
|
|
||||||
navBarHidden: true,
|
|
||||||
statusBarHidden: false,
|
|
||||||
statusBarHideWithNavBar: false,
|
|
||||||
screenBackgroundColor: theme.centerChannelBg
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -77,7 +77,7 @@ class Login extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
goToLoadTeam = (expiresAt) => {
|
goToLoadTeam = (expiresAt) => {
|
||||||
const {intl, navigator, theme} = this.props;
|
const {intl, navigator} = this.props;
|
||||||
tracker.initialLoad = Date.now();
|
tracker.initialLoad = Date.now();
|
||||||
|
|
||||||
if (expiresAt) {
|
if (expiresAt) {
|
||||||
@@ -94,17 +94,17 @@ class Login extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
navigator.resetTo({
|
navigator.resetTo({
|
||||||
screen: 'LoadTeam',
|
screen: 'Channel',
|
||||||
title: '',
|
title: '',
|
||||||
animated: false,
|
animated: false,
|
||||||
backButtonTitle: '',
|
backButtonTitle: '',
|
||||||
navigatorStyle: {
|
navigatorStyle: {
|
||||||
|
animated: true,
|
||||||
|
animationType: 'fade',
|
||||||
|
navBarHidden: true,
|
||||||
statusBarHidden: false,
|
statusBarHidden: false,
|
||||||
statusBarHideWithNavBar: false,
|
statusBarHideWithNavBar: false,
|
||||||
navBarTextColor: theme.sidebarHeaderTextColor,
|
screenBackgroundColor: 'transparent'
|
||||||
navBarBackgroundColor: theme.sidebarHeaderBg,
|
|
||||||
navBarButtonColor: theme.sidebarHeaderTextColor,
|
|
||||||
screenBackgroundColor: theme.centerChannelBg
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -153,7 +153,11 @@ class MoreChannels extends PureComponent {
|
|||||||
|
|
||||||
if (term) {
|
if (term) {
|
||||||
const channels = this.filterChannels(this.state.channels, term);
|
const channels = this.filterChannels(this.state.channels, term);
|
||||||
this.setState({channels, term, searching: true});
|
this.setState({
|
||||||
|
channels,
|
||||||
|
term: text,
|
||||||
|
searching: true
|
||||||
|
});
|
||||||
clearTimeout(this.searchTimeoutId);
|
clearTimeout(this.searchTimeoutId);
|
||||||
|
|
||||||
this.searchTimeoutId = setTimeout(() => {
|
this.searchTimeoutId = setTimeout(() => {
|
||||||
|
|||||||
@@ -162,14 +162,14 @@ class MoreDirectMessages extends PureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onSearch = (text) => {
|
onSearch = (text) => {
|
||||||
const term = text.toLowerCase();
|
const term = text;
|
||||||
|
|
||||||
if (term) {
|
if (term) {
|
||||||
this.setState({searching: true, term});
|
this.setState({searching: true, term});
|
||||||
clearTimeout(this.searchTimeoutId);
|
clearTimeout(this.searchTimeoutId);
|
||||||
|
|
||||||
this.searchTimeoutId = setTimeout(() => {
|
this.searchTimeoutId = setTimeout(() => {
|
||||||
this.searchProfiles(term);
|
this.searchProfiles(term.toLowerCase());
|
||||||
}, General.SEARCH_TIMEOUT_MILLISECONDS);
|
}, General.SEARCH_TIMEOUT_MILLISECONDS);
|
||||||
} else {
|
} else {
|
||||||
this.cancelSearch();
|
this.cancelSearch();
|
||||||
|
|||||||
@@ -1,29 +1,12 @@
|
|||||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import {bindActionCreators} from 'redux';
|
import React from 'react';
|
||||||
import {connect} from 'react-redux';
|
|
||||||
|
|
||||||
import {loadMe} from 'mattermost-redux/actions/users';
|
import Loading from 'app/components/loading';
|
||||||
import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';
|
|
||||||
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
|
|
||||||
|
|
||||||
import Root from './root';
|
function Root() {
|
||||||
|
return <Loading/>;
|
||||||
function mapStateToProps(state) {
|
|
||||||
return {
|
|
||||||
currentUser: getCurrentUser(state),
|
|
||||||
credentials: state.entities.general.credentials,
|
|
||||||
theme: getTheme(state)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapDispatchToProps(dispatch) {
|
export default Root;
|
||||||
return {
|
|
||||||
actions: bindActionCreators({
|
|
||||||
loadMe
|
|
||||||
}, dispatch)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(Root);
|
|
||||||
|
|||||||
@@ -1,101 +0,0 @@
|
|||||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
||||||
// See License.txt for license information.
|
|
||||||
|
|
||||||
import React, {Component} from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
|
|
||||||
import {Client, Client4} from 'mattermost-redux/client';
|
|
||||||
|
|
||||||
import Loading from 'app/components/loading';
|
|
||||||
import {stripTrailingSlashes} from 'app/utils/url';
|
|
||||||
import tracker from 'app/utils/time_tracker';
|
|
||||||
|
|
||||||
export default class Root extends Component {
|
|
||||||
static propTypes = {
|
|
||||||
actions: PropTypes.shape({
|
|
||||||
loadMe: PropTypes.func.isRequired
|
|
||||||
}).isRequired,
|
|
||||||
allowOtherServers: PropTypes.bool,
|
|
||||||
currentUser: PropTypes.object,
|
|
||||||
credentials: PropTypes.object,
|
|
||||||
justInit: PropTypes.bool,
|
|
||||||
navigator: PropTypes.object,
|
|
||||||
theme: PropTypes.object
|
|
||||||
};
|
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps) {
|
|
||||||
if (nextProps.credentials !== this.props.credentials) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
if (!this.props.justInit) {
|
|
||||||
this.loadStoreAndScene();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
goToLoadTeam = () => {
|
|
||||||
const {navigator, theme} = this.props;
|
|
||||||
tracker.initialLoad = Date.now();
|
|
||||||
navigator.resetTo({
|
|
||||||
screen: 'LoadTeam',
|
|
||||||
title: '',
|
|
||||||
animated: true,
|
|
||||||
animationType: 'fade',
|
|
||||||
backButtonTitle: '',
|
|
||||||
navigatorStyle: {
|
|
||||||
statusBarHidden: false,
|
|
||||||
statusBarHideWithNavBar: false,
|
|
||||||
navBarTextColor: theme.sidebarHeaderTextColor,
|
|
||||||
navBarBackgroundColor: theme.sidebarHeaderBg,
|
|
||||||
navBarButtonColor: theme.sidebarHeaderTextColor,
|
|
||||||
screenBackgroundColor: theme.centerChannelBg
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
goToSelectServer = () => {
|
|
||||||
const {allowOtherServers, navigator} = this.props;
|
|
||||||
|
|
||||||
navigator.resetTo({
|
|
||||||
screen: 'SelectServer',
|
|
||||||
animated: true,
|
|
||||||
animationType: 'fade',
|
|
||||||
navigatorStyle: {
|
|
||||||
navBarHidden: true,
|
|
||||||
navBarBackgroundColor: 'black',
|
|
||||||
statusBarHidden: false,
|
|
||||||
statusBarHideWithNavBar: false
|
|
||||||
},
|
|
||||||
passProps: {
|
|
||||||
allowOtherServers
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
loadStoreAndScene = () => {
|
|
||||||
const {actions, currentUser, credentials} = this.props;
|
|
||||||
const {loadMe} = actions;
|
|
||||||
if (credentials.token && credentials.url) {
|
|
||||||
Client.setToken(credentials.token);
|
|
||||||
Client4.setToken(credentials.token);
|
|
||||||
Client4.setUrl(stripTrailingSlashes(credentials.url));
|
|
||||||
Client.setUrl(stripTrailingSlashes(credentials.url));
|
|
||||||
|
|
||||||
if (currentUser) {
|
|
||||||
loadMe();
|
|
||||||
this.goToLoadTeam();
|
|
||||||
} else {
|
|
||||||
loadMe().then(this.goToLoadTeam).catch(this.goToLoadTeam);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.goToSelectServer();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return <Loading/>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
import Button from 'react-native-button';
|
import Button from 'react-native-button';
|
||||||
import urlParse from 'url-parse';
|
import urlParse from 'url-parse';
|
||||||
|
|
||||||
import {Client, Client4} from 'mattermost-redux/client';
|
import {Client4} from 'mattermost-redux/client';
|
||||||
|
|
||||||
import Config from 'assets/config';
|
import Config from 'assets/config';
|
||||||
import ErrorText from 'app/components/error_text';
|
import ErrorText from 'app/components/error_text';
|
||||||
@@ -224,7 +224,6 @@ class SelectServer extends PureComponent {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Client4.setUrl(url);
|
Client4.setUrl(url);
|
||||||
Client.setUrl(url);
|
|
||||||
handleServerUrlChanged(url);
|
handleServerUrlChanged(url);
|
||||||
|
|
||||||
let cancel = false;
|
let cancel = false;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class SSO extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
goToLoadTeam = (expiresAt) => {
|
goToLoadTeam = (expiresAt) => {
|
||||||
const {intl, navigator, theme} = this.props;
|
const {intl, navigator} = this.props;
|
||||||
tracker.initialLoad = Date.now();
|
tracker.initialLoad = Date.now();
|
||||||
|
|
||||||
if (expiresAt) {
|
if (expiresAt) {
|
||||||
@@ -99,17 +99,17 @@ class SSO extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
navigator.resetTo({
|
navigator.resetTo({
|
||||||
screen: 'LoadTeam',
|
screen: 'Channel',
|
||||||
title: '',
|
title: '',
|
||||||
animated: false,
|
animated: false,
|
||||||
backButtonTitle: '',
|
backButtonTitle: '',
|
||||||
navigatorStyle: {
|
navigatorStyle: {
|
||||||
|
animated: true,
|
||||||
|
animationType: 'fade',
|
||||||
|
navBarHidden: true,
|
||||||
statusBarHidden: false,
|
statusBarHidden: false,
|
||||||
statusBarHideWithNavBar: false,
|
statusBarHideWithNavBar: false,
|
||||||
navBarTextColor: theme.sidebarHeaderTextColor,
|
screenBackgroundColor: 'transparent'
|
||||||
navBarBackgroundColor: theme.sidebarHeaderBg,
|
|
||||||
navBarButtonColor: theme.sidebarHeaderTextColor,
|
|
||||||
screenBackgroundColor: theme.centerChannelBg
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2225,7 +2225,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
CURRENT_PROJECT_VERSION = 85;
|
CURRENT_PROJECT_VERSION = 86;
|
||||||
DEAD_CODE_STRIPPING = NO;
|
DEAD_CODE_STRIPPING = NO;
|
||||||
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
|
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
@@ -2274,7 +2274,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
CURRENT_PROJECT_VERSION = 85;
|
CURRENT_PROJECT_VERSION = 86;
|
||||||
DEAD_CODE_STRIPPING = NO;
|
DEAD_CODE_STRIPPING = NO;
|
||||||
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
|
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.6.0</string>
|
<string>1.6.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>85</string>
|
<string>86</string>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|||||||
@@ -15,10 +15,10 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>BNDL</string>
|
<string>BNDL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.3.0</string>
|
<string>1.6.1</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>85</string>
|
<string>86</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
Reference in New Issue
Block a user