MM-15428 Fix iOS when managed config is not set (#2768)

This commit is contained in:
Elias Nahum
2019-05-03 23:18:41 -04:00
committed by Miguel Alatzar
parent 7859b85391
commit dfd011aebc

View File

@@ -8,6 +8,7 @@ const {BlurAppScreen, MattermostManaged} = NativeModules;
const mattermostManagedEmitter = new NativeEventEmitter(MattermostManaged);
const listeners = [];
const emptyObject = {};
let cachedConfig = {};
export default {
@@ -38,7 +39,7 @@ export default {
blurAppScreen: BlurAppScreen.enabled,
getConfig: async () => {
try {
cachedConfig = await MattermostManaged.getConfig();
cachedConfig = await MattermostManaged.getConfig() || emptyObject;
} catch (error) {
// do nothing...
}