@pitcher/core
Advanced tools
Comparing version 0.36.4 to 0.36.5
@@ -268,3 +268,3 @@ 'use strict'; | ||
case 0: | ||
source = _args.length > 0 && _args[0] !== undefined ? _args[0] : 'modal'; | ||
source = _args.length > 0 && _args[0] !== undefined ? _args[0] : window.__pitcher__TiEventSource || 'modal'; | ||
configReady.value = false; | ||
@@ -284,7 +284,8 @@ store = useConfigStore(); | ||
config = params$1.appConfig || {}; | ||
_context.next = 13; | ||
_context.next = 20; | ||
break; | ||
case 10: | ||
_context.next = 12; | ||
_context.prev = 10; | ||
_context.next = 13; | ||
return event.fireEvent('getAppConfig', { | ||
@@ -294,6 +295,14 @@ source: source | ||
case 12: | ||
case 13: | ||
config = _context.sent; | ||
_context.next = 20; | ||
break; | ||
case 13: | ||
case 16: | ||
_context.prev = 16; | ||
_context.t0 = _context["catch"](10); | ||
console.warn('Error loading config json, defaulting to empty object', _context.t0); | ||
config = {}; | ||
case 20: | ||
if (platform.isWindows && Array.isArray(config)) { | ||
@@ -304,3 +313,3 @@ config = config[0]; | ||
if (!(typeof config.userAttrSpecificSettings !== 'undefined')) { | ||
_context.next = 24; | ||
_context.next = 31; | ||
break; | ||
@@ -310,3 +319,3 @@ } | ||
if (!params$1.user) { | ||
_context.next = 19; | ||
_context.next = 26; | ||
break; | ||
@@ -316,7 +325,7 @@ } | ||
user = params$1.user; | ||
_context.next = 23; | ||
_context.next = 30; | ||
break; | ||
case 19: | ||
_context.next = 21; | ||
case 26: | ||
_context.next = 28; | ||
return event.fireEvent('getSFInfo', { | ||
@@ -326,7 +335,7 @@ source: source | ||
case 21: | ||
case 28: | ||
sfInfo = _context.sent; | ||
user = sfInfo && sfInfo.user ? sfInfo.user : undefined; | ||
case 23: | ||
case 30: | ||
if (user) { | ||
@@ -359,3 +368,3 @@ config.userAttrSpecificSettings.forEach(function (custom) { | ||
case 24: | ||
case 31: | ||
parsedData = platform.isPConnect ? config : parseConfigData(config); | ||
@@ -374,3 +383,3 @@ console.log('[@pitcher/core]: app config', parsedData); | ||
case 29: | ||
case 36: | ||
case "end": | ||
@@ -380,3 +389,3 @@ return _context.stop(); | ||
} | ||
}, _callee); | ||
}, _callee, null, [[10, 16]]); | ||
})); | ||
@@ -383,0 +392,0 @@ return _loadConfig.apply(this, arguments); |
@@ -253,3 +253,3 @@ import _regeneratorRuntime from '@babel/runtime/regenerator'; | ||
case 0: | ||
source = _args.length > 0 && _args[0] !== undefined ? _args[0] : 'modal'; | ||
source = _args.length > 0 && _args[0] !== undefined ? _args[0] : window.__pitcher__TiEventSource || 'modal'; | ||
configReady.value = false; | ||
@@ -269,7 +269,8 @@ store = useConfigStore(); | ||
config = params.appConfig || {}; | ||
_context.next = 13; | ||
_context.next = 20; | ||
break; | ||
case 10: | ||
_context.next = 12; | ||
_context.prev = 10; | ||
_context.next = 13; | ||
return fireEvent('getAppConfig', { | ||
@@ -279,6 +280,14 @@ source: source | ||
case 12: | ||
case 13: | ||
config = _context.sent; | ||
_context.next = 20; | ||
break; | ||
case 13: | ||
case 16: | ||
_context.prev = 16; | ||
_context.t0 = _context["catch"](10); | ||
console.warn('Error loading config json, defaulting to empty object', _context.t0); | ||
config = {}; | ||
case 20: | ||
if (isWindows && Array.isArray(config)) { | ||
@@ -289,3 +298,3 @@ config = config[0]; | ||
if (!(typeof config.userAttrSpecificSettings !== 'undefined')) { | ||
_context.next = 24; | ||
_context.next = 31; | ||
break; | ||
@@ -295,3 +304,3 @@ } | ||
if (!params.user) { | ||
_context.next = 19; | ||
_context.next = 26; | ||
break; | ||
@@ -301,7 +310,7 @@ } | ||
user = params.user; | ||
_context.next = 23; | ||
_context.next = 30; | ||
break; | ||
case 19: | ||
_context.next = 21; | ||
case 26: | ||
_context.next = 28; | ||
return fireEvent('getSFInfo', { | ||
@@ -311,7 +320,7 @@ source: source | ||
case 21: | ||
case 28: | ||
sfInfo = _context.sent; | ||
user = sfInfo && sfInfo.user ? sfInfo.user : undefined; | ||
case 23: | ||
case 30: | ||
if (user) { | ||
@@ -344,3 +353,3 @@ config.userAttrSpecificSettings.forEach(function (custom) { | ||
case 24: | ||
case 31: | ||
parsedData = isPConnect ? config : parseConfigData(config); | ||
@@ -359,3 +368,3 @@ console.log('[@pitcher/core]: app config', parsedData); | ||
case 29: | ||
case 36: | ||
case "end": | ||
@@ -365,3 +374,3 @@ return _context.stop(); | ||
} | ||
}, _callee); | ||
}, _callee, null, [[10, 16]]); | ||
})); | ||
@@ -368,0 +377,0 @@ return _loadConfig.apply(this, arguments); |
{ | ||
"name": "@pitcher/core", | ||
"version": "0.36.4", | ||
"version": "0.36.5", | ||
"description": "Pitcher Ti helpers & Core features to integrate Ti app", | ||
@@ -39,3 +39,3 @@ "author": "Pitcher AG", | ||
"sideEffects": false, | ||
"gitHead": "4ced19278da6ff5957bac9a2ada93a2bea2b4548" | ||
"gitHead": "aca5ab02468a45d6c6980cce4e9cf42a929bc845" | ||
} |
@@ -221,3 +221,3 @@ import Vue from 'vue' | ||
export async function loadConfig(source = 'modal') { | ||
export async function loadConfig(source = window.__pitcher__TiEventSource || 'modal') { | ||
configReady.value = false | ||
@@ -233,3 +233,8 @@ | ||
} else { | ||
config = await fireEvent('getAppConfig', { source }) | ||
try { | ||
config = await fireEvent('getAppConfig', { source }) | ||
} catch (e) { | ||
console.warn('Error loading config json, defaulting to empty object', e) | ||
config = {} | ||
} | ||
} | ||
@@ -236,0 +241,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
743452
15495