@everymatrix/user-actions 1.30.1 → 1.31.1

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.
@@ -41,7 +41,7 @@ const UserActions = class {
41
41
  };
42
42
  }
43
43
  handleEvent(e) {
44
- if (actionsMapping[this.actionStack[0].action].listen === e.data) {
44
+ if (actionsMapping[this.actionStack[0].action].listen === e.data.type) {
45
45
  this.shiftActionStack();
46
46
  if (this.actionStack.length > 0)
47
47
  this.emitCurrentActionEvent();
@@ -11,7 +11,7 @@ export class UserActions {
11
11
  };
12
12
  }
13
13
  handleEvent(e) {
14
- if (actionsMapping[this.actionStack[0].action].listen === e.data) {
14
+ if (actionsMapping[this.actionStack[0].action].listen === e.data.type) {
15
15
  this.shiftActionStack();
16
16
  if (this.actionStack.length > 0)
17
17
  this.emitCurrentActionEvent();
@@ -39,7 +39,7 @@ const UserActions$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
39
39
  };
40
40
  }
41
41
  handleEvent(e) {
42
- if (actionsMapping[this.actionStack[0].action].listen === e.data) {
42
+ if (actionsMapping[this.actionStack[0].action].listen === e.data.type) {
43
43
  this.shiftActionStack();
44
44
  if (this.actionStack.length > 0)
45
45
  this.emitCurrentActionEvent();
@@ -37,7 +37,7 @@ const UserActions = class {
37
37
  };
38
38
  }
39
39
  handleEvent(e) {
40
- if (actionsMapping[this.actionStack[0].action].listen === e.data) {
40
+ if (actionsMapping[this.actionStack[0].action].listen === e.data.type) {
41
41
  this.shiftActionStack();
42
42
  if (this.actionStack.length > 0)
43
43
  this.emitCurrentActionEvent();
@@ -1 +1 @@
1
- import{r as i}from"./p-d8d5dc61.js";const t={"verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"get-temporary-account-consents":{emit:"openTemporaryConsentsModal",listen:"closeTemporaryConsentsModal"},"limits-popup":{emit:"openLugasPopup",listen:"closeLugasPopup"},"video-verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"unverified-phone-number":{emit:"openSmsVerificationModal",listen:"closeSmsVerificationModal"}},o=class{constructor(o){i(this,o),this.actionStack=[],this.emitCurrentActionEvent=()=>{window.postMessage({type:t[this.actionStack[0].action].emit})},this.shiftActionStack=()=>{this.actionStack=this.actionStack.slice(1)}}handleEvent(i){t[this.actionStack[0].action].listen===i.data&&(this.shiftActionStack(),this.actionStack.length>0&&this.emitCurrentActionEvent())}fetchUserActions(){const i=new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);return fetch(i.href).then((i=>i.json())).then((i=>{this.actionStack=i.actions,this.actionStack.length>0&&this.emitCurrentActionEvent()}))}componentWillLoad(){return this.fetchUserActions()}render(){}};o.style=":host{display:block}";export{o as user_actions}
1
+ import{r as i}from"./p-d8d5dc61.js";const t={"verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"get-temporary-account-consents":{emit:"openTemporaryConsentsModal",listen:"closeTemporaryConsentsModal"},"limits-popup":{emit:"openLugasPopup",listen:"closeLugasPopup"},"video-verification-popup":{emit:"openKycVerificationModal",listen:"closeKycVerificationModal"},"unverified-phone-number":{emit:"openSmsVerificationModal",listen:"closeSmsVerificationModal"}},o=class{constructor(o){i(this,o),this.actionStack=[],this.emitCurrentActionEvent=()=>{window.postMessage({type:t[this.actionStack[0].action].emit})},this.shiftActionStack=()=>{this.actionStack=this.actionStack.slice(1)}}handleEvent(i){t[this.actionStack[0].action].listen===i.data.type&&(this.shiftActionStack(),this.actionStack.length>0&&this.emitCurrentActionEvent())}fetchUserActions(){const i=new URL(`${this.endpoint}/v1/player/${this.userid}/legislation/actions`);return fetch(i.href).then((i=>i.json())).then((i=>{this.actionStack=i.actions,this.actionStack.length>0&&this.emitCurrentActionEvent()}))}componentWillLoad(){return this.fetchUserActions()}render(){}};o.style=":host{display:block}";export{o as user_actions}
@@ -1 +1 @@
1
- import{p as e,b as n}from"./p-d8d5dc61.js";(()=>{const n=import.meta.url,s={};return""!==n&&(s.resourcesUrl=new URL(".",n).href),e(s)})().then((e=>n([["p-04130d8e",[[1,"user-actions",{endpoint:[1],userid:[1],actionStack:[32]},[[8,"message","handleEvent"]]]]]],e)));
1
+ import{p as e,b as n}from"./p-d8d5dc61.js";(()=>{const n=import.meta.url,s={};return""!==n&&(s.resourcesUrl=new URL(".",n).href),e(s)})().then((e=>n([["p-31fa2e47",[[1,"user-actions",{endpoint:[1],userid:[1],actionStack:[32]},[[8,"message","handleEvent"]]]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/user-actions",
3
- "version": "1.30.1",
3
+ "version": "1.31.1",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",