mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 14:18:08 +00:00
custom callbacks from base element
This commit is contained in:
@@ -13,18 +13,18 @@ class HistoryPageElement extends BasePageElement {
|
||||
super();
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
elementConnected = () => {
|
||||
this.transactionsService = new TransactionsService(
|
||||
this.appMain?.appService
|
||||
);
|
||||
this.update();
|
||||
this.pagination?.setFetchFunc?.(this.getTransactions, true)!;
|
||||
window.addEventListener("tokenchange", this.update);
|
||||
}
|
||||
};
|
||||
|
||||
disconnectedCallback(): void {
|
||||
elementDisconnected = () => {
|
||||
window.removeEventListener("tokenchange", this.update);
|
||||
}
|
||||
};
|
||||
|
||||
getTransactions = async (options) => {
|
||||
try {
|
||||
|
||||
@@ -12,15 +12,15 @@ class HomePageElement extends BasePageElement {
|
||||
super();
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
elementConnected = () => {
|
||||
this.pingService = new PingService(this.appMain?.appService);
|
||||
this.update();
|
||||
window.addEventListener("tokenchange", this.update);
|
||||
}
|
||||
};
|
||||
|
||||
disconnectedCallback(): void {
|
||||
elementDisconnected = (): void => {
|
||||
window.removeEventListener("tokenchange", this.update);
|
||||
}
|
||||
};
|
||||
|
||||
getPong = async () => {
|
||||
try {
|
||||
|
||||
@@ -21,11 +21,11 @@ class LoginPageElement extends BasePageElement {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
connectedCallback() {
|
||||
elementConnected = () => {
|
||||
this.authService = new AuthService(this.appMain.appService);
|
||||
this.routerService = this.appMain.routerService;
|
||||
this.update();
|
||||
}
|
||||
};
|
||||
|
||||
get emailInput() {
|
||||
for (const i in this.inputs) {
|
||||
|
||||
@@ -10,9 +10,9 @@ class LogoutPageElement extends BasePageElement {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
connectedCallback() {
|
||||
elementConnected = () => {
|
||||
this.authService = new AuthService(this.appMain.appService);
|
||||
this.appMain?.authStore?.userLogout();
|
||||
this.appMain?.routerService.goTo("/login");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ class NotFoundElement extends BasePageElement {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
connectedCallback() {
|
||||
elementConnected = () => {
|
||||
this.update();
|
||||
}
|
||||
};
|
||||
|
||||
render = () => {
|
||||
return html`
|
||||
|
||||
@@ -12,10 +12,10 @@ class RegisterPageElement extends BasePageElement {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
connectedCallback() {
|
||||
elementConnected = () => {
|
||||
this.authService = new AuthService(this.appMain.appService);
|
||||
this.update();
|
||||
}
|
||||
};
|
||||
|
||||
get values(): Object {
|
||||
const formObject = {};
|
||||
|
||||
Reference in New Issue
Block a user