mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 06:08:10 +00:00
fixed architecture to dispatch events when routes and token changes
This commit is contained in:
@@ -21,13 +21,15 @@ class AppLinkElement extends HTMLElement {
|
||||
this.routerService = this.appMain?.routerService;
|
||||
this.update();
|
||||
if (isTrue(this.goBack)) {
|
||||
window.addEventListener("routechanged", () => {
|
||||
this.update();
|
||||
});
|
||||
window.addEventListener("routechanged", this.update);
|
||||
}
|
||||
}
|
||||
|
||||
public disconnectedCallback(): void {}
|
||||
public disconnectedCallback(): void {
|
||||
if (isTrue(this.goBack)) {
|
||||
window.removeEventListener("routechanged", this.update);
|
||||
}
|
||||
}
|
||||
|
||||
goTo = () => {
|
||||
if (!isTrue(this.goBack) && this.to) {
|
||||
@@ -55,7 +57,7 @@ class AppLinkElement extends HTMLElement {
|
||||
>`}`;
|
||||
}
|
||||
|
||||
update() {
|
||||
update = () => {
|
||||
render(this.render(), this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user