wallet update events

This commit is contained in:
Fran Jurmanović
2021-06-04 23:57:51 +02:00
parent de13f2acae
commit ac59c1d261
8 changed files with 52 additions and 35 deletions

View File

@@ -13,6 +13,11 @@ class AppMainElement extends HTMLElement {
@target appModal: AppModalElement;
@target mainRoot: AppRootElement;
@closest appMain: AppMainElement;
public domEvents: any = {
routechanged: new Event("routechanged"),
tokenchange: new Event("tokenchange"),
walletupdate: new Event("walletupdate"),
};
constructor() {
super();
@@ -114,6 +119,10 @@ class AppMainElement extends HTMLElement {
this.appendChild(_appModal);
};
public triggerWalletUpdate = () => {
this.dispatchEvent(this.domEvents.walletupdate);
};
private createAppModal = () => {
const _appModal = document.createElement("app-modal");
_appModal.setAttribute("data-target", "app-main.appModal");