diff --git a/backend-node b/backend-node index 10837d3..223ea0b 160000 --- a/backend-node +++ b/backend-node @@ -1 +1 @@ -Subproject commit 10837d3b1a66629a9444b13337ec7d37092ed38f +Subproject commit 223ea0b5b34adae6a10a3f9fafe8bf7fad76a4d0 diff --git a/morpherwallet-sdk/package.json b/morpherwallet-sdk/package.json index de3b813..4c6e1cf 100644 --- a/morpherwallet-sdk/package.json +++ b/morpherwallet-sdk/package.json @@ -1,17 +1,19 @@ { "name": "morpherwallet-sdk", - "version": "1.2.7", + "version": "1.2.9", "description": "This is an SDK for the zero-wallet to simply add it to the website. Drop-In Replacement for Fortmatic/Portis/MetaMask", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "build": "tsc" + "build": "npm run bundle && npm run copy", + "bundle": "tsc", + "copy": "@powershell copy package.json lib/package.json && @powershell copy README.md lib/README.md && @powershell copy package-lock.json lib/package-lock.json" }, "author": "Thomas Wiesner (thomas@morpher.com)", "license": "ISC", "repository": { "type": "git", - "url": "https://github.com/Morpher-io/MorpherWallet.git" + "url": "git+https://github.com/Morpher-io/MorpherWallet.git" }, "homepage": "https://www.morpher.com/wallet", "dependencies": { @@ -22,5 +24,11 @@ }, "devDependencies": { "typescript": "^5.5.4" + }, + "bugs": { + "url": "https://github.com/Morpher-io/MorpherWallet/issues" + }, + "directories": { + "lib": "lib" } } diff --git a/morpherwallet-sdk/src/index.ts b/morpherwallet-sdk/src/index.ts index 38c8389..67a08d4 100644 --- a/morpherwallet-sdk/src/index.ts +++ b/morpherwallet-sdk/src/index.ts @@ -27,6 +27,7 @@ export class MorpherWalletProvider extends EventEmitter { protected chainId: number; protected widget: any; public isConnecting: boolean = false; + protected iframeLoad: boolean = false; protected _on2FAUpdateCallback: any; protected _onRecoveryUpdateCallback: any; @@ -96,6 +97,9 @@ protected rpcURL: string; this.morpherWalletContainer = document.createElement('div'); } + this.morpherWalletIframe.addEventListener('load', () => { + this.iframeLoad = true; + }) this.widget = this._initWidget(); @@ -440,26 +444,25 @@ protected rpcURL: string; async iframeLoaded() { return new Promise((resolve) => { - let frame:any = document.getElementById('morpher_wallet_sdk_iframe'); - try { - if (frame && frame.contentWindow && !frame.contentDocument) { - return resolve(true); - } - } catch (err) { - + if (this.iframeLoad) { + return resolve(true); } + let counter = 0 const int = setInterval(() => { - try { - frame = document.getElementById('morpher_wallet_sdk_iframe'); - if (frame && frame.contentWindow && !frame.contentDocument) { - clearInterval(int); - return resolve(true); - } - } catch (err) { + if (this.iframeLoad) { + clearInterval(int) + return resolve(true); } + counter +=1 + if (counter > 200) { + this.iframeLoad = true; + clearInterval(int) + return resolve(true); + } }, 100); }); + } async _setHeight(height: any) { diff --git a/vue b/vue index da44923..e07e384 160000 --- a/vue +++ b/vue @@ -1 +1 @@ -Subproject commit da4492313e475b7d829b75810a3763d26f4b6ea2 +Subproject commit e07e384cd6aa22c27285486d738611308c649281