From 5559ec1e434ebcb1a5d25e88be1c5c682be2f51c Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:10:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0env=20ready=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/scripts/libs/native_bridge.js | 8 ++------ assets/scripts/run_sample.js | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/assets/scripts/libs/native_bridge.js b/assets/scripts/libs/native_bridge.js index 2332cf9..e8569cd 100644 --- a/assets/scripts/libs/native_bridge.js +++ b/assets/scripts/libs/native_bridge.js @@ -1,9 +1,5 @@ import init, { wget_address, - wencrypt, - wdecrypt, - password_hash, - password_verify, hash_pass_svr, sign, sign_for_tran, @@ -18,10 +14,10 @@ let walletCache = []; async function initWasm() { if (jc.wallet.platform === 'web') { - console.log('init wasm'); - await init(); googleClient = new GoogleClient(); + await init(); await googleClient.initGoolgeClient(); + window.dispatchEvent(new CustomEvent('envready')); } } diff --git a/assets/scripts/run_sample.js b/assets/scripts/run_sample.js index ca30fbb..f7da86c 100644 --- a/assets/scripts/run_sample.js +++ b/assets/scripts/run_sample.js @@ -200,3 +200,6 @@ for (let key in pages) { button.addEventListener('click', pages[key]); app.appendChild(button); } +window.addEventListener('envready', (e) => { + console.log('接受到环境初始化事件, 可以显示登录按钮了'); +});