ouisys-engine 2.1.61 → 2.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -176,20 +176,17 @@ var startEvinaAgency = function startEvinaAgency(config) {
176
176
  });
177
177
  var rockmanId = window.pac_analytics.visitor.rockmanId;
178
178
  var url = "https://".concat(newHost, "/tallyman/helper/?action=mi-agency&process=a2-du-evina-start&rockman_id=").concat(rockmanId);
179
-
180
- var callBack = function callBack() {
179
+ fetch(url).then(function (x) {
180
+ return x.text();
181
+ }).then(function (txt) {
182
+ return (0, _loadScriptInnerHtml.default)(txt);
183
+ }).then(function () {
181
184
  console.log('Ev ready');
182
185
  var event = new Event('DCBProtectRun');
183
186
 
184
187
  if (typeof window != "undefined") {
185
188
  document.dispatchEvent(event);
186
189
  }
187
- };
188
-
189
- fetch(url).then(function (x) {
190
- return x.text();
191
- }).then(function (txt) {
192
- return (0, _loadScriptInnerHtml.default)(txt, false, callBack);
193
190
  });
194
191
  };
195
192
 
@@ -1,2 +1,2 @@
1
- declare const loadScriptInnerHtml: (innerHTML: string, isBody?: boolean, callback?: () => void) => void;
1
+ declare const loadScriptInnerHtml: (innerHTML: string, isBody?: boolean) => void;
2
2
  export default loadScriptInnerHtml;
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var loadScriptInnerHtml = function loadScriptInnerHtml(innerHTML, isBody, callback) {
8
+ var loadScriptInnerHtml = function loadScriptInnerHtml(innerHTML, isBody) {
9
9
  var script = document.createElement('script');
10
10
  script.type = 'text/javascript';
11
11
  script.innerHTML = innerHTML;
@@ -17,12 +17,6 @@ var loadScriptInnerHtml = function loadScriptInnerHtml(innerHTML, isBody, callba
17
17
  headElem.insertBefore(script, headElem.firstChild);
18
18
  console.log('loadScript');
19
19
  }
20
-
21
- if (callback) {
22
- script.onload = function () {
23
- callback();
24
- };
25
- }
26
20
  };
27
21
 
28
22
  var _default = loadScriptInnerHtml;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.61",
3
+ "version": "2.1.63",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
@@ -41,14 +41,14 @@ export const startEvinaAgency = (config: IConfig)=>{
41
41
  const newHost = getHost({host});
42
42
  const rockmanId = window.pac_analytics.visitor.rockmanId;
43
43
  const url = `https://${newHost}/tallyman/helper/?action=mi-agency&process=a2-du-evina-start&rockman_id=${rockmanId}`;
44
- const callBack = ()=>{
44
+
45
+ fetch(url).then((x)=>x.text()).then((txt)=>loadScriptInnerHtml(txt)).then(()=>{
45
46
  console.log('Ev ready');
46
47
  let event = new Event('DCBProtectRun');
47
48
  if(typeof window != "undefined"){
48
49
  document.dispatchEvent(event);
49
50
  }
50
- }
51
- fetch(url).then((x)=>x.text()).then((txt)=>loadScriptInnerHtml(txt, false, callBack));
51
+ });
52
52
  }
53
53
 
54
54
  export const mockedMSISDNEntrySuccess : IMoRedirFlowReducerState = {
@@ -1,4 +1,4 @@
1
- const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean, callback?:()=>void)=>{
1
+ const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean)=>{
2
2
  var script = document.createElement('script');
3
3
  script.type = 'text/javascript';
4
4
  script.innerHTML = innerHTML;
@@ -9,13 +9,6 @@ const loadScriptInnerHtml = (innerHTML:string, isBody?:boolean, callback?:()=>vo
9
9
  headElem.insertBefore(script, headElem.firstChild)
10
10
  console.log('loadScript');
11
11
  }
12
-
13
- if(callback){
14
- script.onload = () => {
15
- callback();
16
- }
17
- }
18
-
19
12
  }
20
13
 
21
14
  export default loadScriptInnerHtml;