diff --git a/packages/idos-sdk-js/src/lib/enclave-providers/iframe-enclave.ts b/packages/idos-sdk-js/src/lib/enclave-providers/iframe-enclave.ts index 466765be6..ce34de948 100644 --- a/packages/idos-sdk-js/src/lib/enclave-providers/iframe-enclave.ts +++ b/packages/idos-sdk-js/src/lib/enclave-providers/iframe-enclave.ts @@ -111,6 +111,12 @@ export class IframeEnclave implements EnclaveProvider { } async #loadEnclave() { + const hasIframe = document.getElementById(this.iframe.id); + if (hasIframe) { + console.warn("An Iframe already exists in the container"); + return Promise.resolve(); + } + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy#directives const permissionsPolicies = ["publickey-credentials-get", "storage-access"]; diff --git a/packages/idos-sdk-js/src/lib/idos.ts b/packages/idos-sdk-js/src/lib/idos.ts index ea4f98f9a..47b7c5af0 100644 --- a/packages/idos-sdk-js/src/lib/idos.ts +++ b/packages/idos-sdk-js/src/lib/idos.ts @@ -25,7 +25,6 @@ interface InitParams { export class idOS { static initializing = false; - static near = Grants.near; static evm = Grants.evm; static kwil = KwilWrapper.defaults; @@ -109,6 +108,7 @@ export class idOS { async reset({ enclave = false } = {}): Promise { this.store.reset(); + idOS.initializing = false; if (enclave) await this.enclave.reset(); }