diff --git a/CHANGELOG.md b/CHANGELOG.md index c525435..02239e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] + +## [[0.1.2](https://github.com/multiversx/mx-wallet-dapp/pull/40)] - 2024-04-25 +- [Fixed double mounting of web component](https://github.com/multiversx/mx-wallet-dapp/pull/39) + ## [[0.1.1](https://github.com/multiversx/mx-wallet-dapp/pull/38)] - 2024-04-23 - [Removed old `out` folder and recreated it with compile](https://github.com/multiversx/mx-wallet-dapp/pull/38) diff --git a/package-lock.json b/package-lock.json index 3e48d3e..bcb44f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@multiversx/sdk-web-wallet-cross-window-provider", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@multiversx/sdk-web-wallet-cross-window-provider", - "version": "0.1.1", + "version": "0.1.2", "license": "GPL-3.0-or-later", "dependencies": { "@types/jest": "^29.5.11", diff --git a/package.json b/package.json index 646c76d..28aba4c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@multiversx/sdk-web-wallet-cross-window-provider", - "version": "0.1.1", + "version": "0.1.2", "description": "Signing provider for dApps: Cross Window", "main": "out/index.js", "types": "out/index.d.js", diff --git a/src/CrossWindowProvider/PopupConsent/PopupConsent.ts b/src/CrossWindowProvider/PopupConsent/PopupConsent.ts index f3ae1e5..5062ea8 100644 --- a/src/CrossWindowProvider/PopupConsent/PopupConsent.ts +++ b/src/CrossWindowProvider/PopupConsent/PopupConsent.ts @@ -1,10 +1,10 @@ +import { safeWindow } from '@multiversx/sdk-dapp-utils/out/constants/crossWindowProviderConstants'; import { LitElement, html } from 'lit'; -import { customElement, property } from 'lit/decorators.js'; +import { property } from 'lit/decorators.js'; import { getStyles } from './getStyles'; export const confirmationDialogTag = 'mxcwp-confirmation-dialog'; -@customElement(confirmationDialogTag) export class PopupConsent extends LitElement { @property({ type: String }) id = confirmationDialogTag; @@ -108,3 +108,8 @@ export class PopupConsent extends LitElement { this.toggleEvents('removeEventListener'); } } + +const customElements = safeWindow?.customElements; +if (customElements && !customElements.get(confirmationDialogTag)) { + customElements.define(confirmationDialogTag, PopupConsent); +}