chanage sth
This commit is contained in:
parent
29dcd58ae2
commit
69ed43b36e
@ -6,6 +6,7 @@ import {
|
||||
IChainData,
|
||||
} from "../configs/config_chain";
|
||||
import {
|
||||
ACCOUNT_CHANGE,
|
||||
EventBus,
|
||||
NEED_CHANGE_CHAIN,
|
||||
NEED_LOGIN,
|
||||
@ -330,6 +331,12 @@ export class Blockchain {
|
||||
if (UserModule.accountId !== accounts[0]) {
|
||||
this.clearCachedProvider();
|
||||
await UserModule.LogOut();
|
||||
EventBus.$emit(ACCOUNT_CHANGE, accounts[0]);
|
||||
let event = new Event("account_change", {
|
||||
bubbles: true,
|
||||
cancelable: false,
|
||||
});
|
||||
window.dispatchEvent(event);
|
||||
setTimeout(() => {
|
||||
location.reload();
|
||||
}, 1000);
|
||||
|
@ -36,3 +36,5 @@ export class JCChain {
|
||||
}
|
||||
|
||||
export * from "./utils/event-bus";
|
||||
export * from "./utils/chain.util";
|
||||
export * from "./utils/browser";
|
||||
|
Loading…
x
Reference in New Issue
Block a user