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('接受到环境初始化事件, 可以显示登录按钮了'); +});