@chapeaux/cpx-user
Advanced tools
Comparing version 0.8.1 to 0.8.2
@@ -97,11 +97,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
if (this.eddl) { | ||
this._worker.postMessage({ | ||
action: 'getCookies', | ||
values: new Map([ | ||
['rh_common_id', 'custKey'], | ||
['rh_user_id', 'userID'], | ||
['rh_sso_session', 'loggedIn'] | ||
]), | ||
payload: document.cookie | ||
}); | ||
this.initWorker(); | ||
} | ||
@@ -119,3 +111,2 @@ this.ready = true; | ||
}); | ||
this.initWorker(); | ||
} | ||
@@ -184,10 +175,21 @@ static get observedAttributes() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
this._worker = new Worker(import.meta.url.replace('cpx-user.js', 'user.js')); | ||
this.worker['onmessage'] = this.onmessage; | ||
if (!this._worker) { | ||
try { | ||
this._worker = new Worker(import.meta.url.replace('cpx-user.js', 'user.js')); | ||
this.worker['onmessage'] = this.onmessage; | ||
} | ||
catch (_a) { | ||
const { Peasant } = yield import(import.meta.url.replace('cpx-user.js', 'peasant.js')); | ||
this._worker = new Peasant(this); | ||
} | ||
} | ||
catch (_a) { | ||
const { Peasant } = yield import(import.meta.url.replace('cpx-user.js', 'peasant.js')); | ||
this._worker = new Peasant(this); | ||
} | ||
this._worker.postMessage({ | ||
action: 'getCookies', | ||
values: new Map([ | ||
['rh_common_id', 'custKey'], | ||
['rh_user_id', 'userID'], | ||
['rh_sso_session', 'loggedIn'] | ||
]), | ||
payload: document.cookie | ||
}); | ||
}); | ||
@@ -194,0 +196,0 @@ } |
{ | ||
"name": "@chapeaux/cpx-user", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "Chapeaux User Component", | ||
@@ -5,0 +5,0 @@ "type": "module", |
50170
320