multiple changes

WW-26 - render and update methods are now arrow functions
WW-18 - created history page for listing transactions
WW-12 - list wallets on menu
This commit is contained in:
Fran Jurmanović
2021-05-31 18:23:39 +02:00
parent 53c27718a9
commit 551543a9e7
19 changed files with 262 additions and 64 deletions

View File

@@ -11,13 +11,14 @@ class LoginPageElement extends HTMLElement {
@closest appMain: AppMainElement;
authService: AuthService;
routerService: RouterService;
errorMessage: string;
constructor() {
super();
}
@update
connectedCallback() {
this.authService = new AuthService(this.appMain.appService);
this.routerService = this.appMain.routerService;
this.update();
}
get emailInput() {
@@ -65,6 +66,9 @@ class LoginPageElement extends HTMLElement {
} else if (err?.errorCode == 400104) {
this.passwordInput.error = err?.message;
this.passwordInput.update();
} else {
this.errorMessage = "Unable to log in!";
this.update();
}
}
};
@@ -78,7 +82,7 @@ class LoginPageElement extends HTMLElement {
return _return;
}
render() {
render = () => {
return html`
<form>
<input-field
@@ -96,6 +100,7 @@ class LoginPageElement extends HTMLElement {
data-rules="required"
>
</input-field>
${this.errorMessage && html`<div>${this.errorMessage}</div>`}
<button type="button" data-action="click:login-page#onSubmit">
Login
</button>
@@ -107,7 +112,7 @@ class LoginPageElement extends HTMLElement {
></app-link>
</div>
`;
}
};
update() {
render(this.render(), this);