增加env ready事件

This commit is contained in:
CounterFire2023 2023-09-13 17:10:02 +08:00
parent edc3f97359
commit 5559ec1e43
2 changed files with 5 additions and 6 deletions

View File

@ -1,9 +1,5 @@
import init, { import init, {
wget_address, wget_address,
wencrypt,
wdecrypt,
password_hash,
password_verify,
hash_pass_svr, hash_pass_svr,
sign, sign,
sign_for_tran, sign_for_tran,
@ -18,10 +14,10 @@ let walletCache = [];
async function initWasm() { async function initWasm() {
if (jc.wallet.platform === 'web') { if (jc.wallet.platform === 'web') {
console.log('init wasm');
await init();
googleClient = new GoogleClient(); googleClient = new GoogleClient();
await init();
await googleClient.initGoolgeClient(); await googleClient.initGoolgeClient();
window.dispatchEvent(new CustomEvent('envready'));
} }
} }

View File

@ -200,3 +200,6 @@ for (let key in pages) {
button.addEventListener('click', pages[key]); button.addEventListener('click', pages[key]);
app.appendChild(button); app.appendChild(button);
} }
window.addEventListener('envready', (e) => {
console.log('接受到环境初始化事件, 可以显示登录按钮了');
});