custom callbacks from base element

This commit is contained in:
Fran Jurmanović
2021-06-02 14:05:38 +02:00
parent ffef98e7a5
commit ca51c304f3
21 changed files with 122 additions and 148 deletions

View File

@@ -12,16 +12,16 @@ class MenuLayoutElement extends BaseLayoutElement {
super();
}
connectedCallback() {
elementConnected = () => {
this.update();
window.addEventListener("tokenchange", this.updateAuth);
window.addEventListener("routechanged", this.updateAuth);
}
};
disconnectedCallback(): void {
elementDisconnected = () => {
window.removeEventListener("tokenchange", this.updateAuth);
window.removeEventListener("routechanged", this.updateAuth);
}
};
get isAuth() {
const _is = this.appMain?.routerService?.routerState?.middleware;