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