Automated cherry pick of #4203 (#4215)

* Fix Crash on iOS with EMM enabled

* Fix Android Passcode authentication

* Fix Login screen header when EMM does not allow other servers

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
Mattermost Build 2020-04-23 12:10:39 +02:00 committed by GitHub
parent 968507d8c9
commit 9f578461e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 5 deletions

View file

@ -36,11 +36,12 @@ export default {
listeners.splice(index, 1);
}
},
authenticate: () => {
authenticate: (opts) => {
if (!LocalAuth) {
LocalAuth = require('react-native-local-auth');
}
return LocalAuth.auth;
return LocalAuth.auth(opts);
},
blurAppScreen: emptyFunction,
appGroupIdentifier: null,

View file

@ -67,6 +67,10 @@ export default class SelectServer extends PureComponent {
serverUrl: PropTypes.string.isRequired,
};
static defaultProps = {
allowOtherServers: true,
};
static contextTypes = {
intl: intlShape.isRequired,
};
@ -159,11 +163,18 @@ export default class SelectServer extends PureComponent {
};
goToNextScreen = (screen, title, passProps = {}, navOptions = {}) => {
const {allowOtherServers} = this.props;
let visible = !LocalConfig.AutoSelectServerUrl;
if (!allowOtherServers) {
visible = false;
}
const defaultOptions = {
popGesture: !LocalConfig.AutoSelectServerUrl,
popGesture: visible,
topBar: {
visible: !LocalConfig.AutoSelectServerUrl,
height: LocalConfig.AutoSelectServerUrl ? 0 : null,
visible,
height: visible ? null : 0,
},
};
const options = merge(defaultOptions, navOptions);

View file

@ -215,6 +215,8 @@ PODS:
- React
- react-native-image-picker (2.3.1):
- React
- react-native-local-auth (1.6.0):
- React
- react-native-mmkv-storage (0.3.1):
- MMKV (= 1.1.0)
- React
@ -344,6 +346,7 @@ DEPENDENCIES:
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-hw-keyboard-event (from `../node_modules/react-native-hw-keyboard-event`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- react-native-local-auth (from `../node_modules/react-native-local-auth`)
- react-native-mmkv-storage (from `../node_modules/react-native-mmkv-storage`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
- react-native-notifications (from `../node_modules/react-native-notifications`)
@ -443,6 +446,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-hw-keyboard-event"
react-native-image-picker:
:path: "../node_modules/react-native-image-picker"
react-native-local-auth:
:path: "../node_modules/react-native-local-auth"
react-native-mmkv-storage:
:path: "../node_modules/react-native-mmkv-storage"
react-native-netinfo:
@ -539,6 +544,7 @@ SPEC CHECKSUMS:
react-native-document-picker: 0573c02d742d4bef38a5d16b5f039754cfa69888
react-native-hw-keyboard-event: b517cefb8d5c659a38049c582de85ff43337dc53
react-native-image-picker: 668e72d0277dc8c12ae90e835507c1eddd2e4f85
react-native-local-auth: 359af242caa1e5c501ac9dfe33b1e238ad8f08c6
react-native-mmkv-storage: d413e1e00b1f410a744e1d547a912a1f87e67260
react-native-netinfo: 892a5130be97ff8bb69c523739c424a2ffc296d1
react-native-notifications: d5cb54ef8bf3004dcb56c887650dea08ecbddee7

View file

@ -170,3 +170,29 @@ index 38b78f1..a47afea 100644
} catch (Exception e) {
authPromise.reject(E_FAILED_TO_SHOW_AUTH, e);
authPromise = null;
diff --git a/node_modules/react-native-local-auth/react-native-local-auth.podspec b/node_modules/react-native-local-auth/react-native-local-auth.podspec
new file mode 100644
index 0000000..5f9a6b4
--- /dev/null
+++ b/node_modules/react-native-local-auth/react-native-local-auth.podspec
@@ -0,0 +1,20 @@
+require "json"
+package = JSON.parse(File.read(File.join(__dir__, '/package.json')))
+
+Pod::Spec.new do |s|
+ s.name = package['name']
+ s.version = package['version']
+ s.summary = package['description']
+ s.description = package['description']
+ s.homepage = package['homepage']
+ s.license = package['license']
+ s.author = package['author']
+ s.source = { :git => 'https://github.com/tradle/react-native-local-auth.git' }
+
+ s.platform = :ios, '9.0'
+ s.ios.deployment_target = '9.0'
+
+ s.source_files = "*.{h,m}"
+
+ s.dependency 'React'
+end