fix: move code to not render html when not needed
This commit is contained in:
parent
6dc0293455
commit
d5e692449b
@ -35,15 +35,17 @@ export default class extends AbstractView {
|
||||
|
||||
async postInit()
|
||||
{
|
||||
let login_button = document.getElementById("button")
|
||||
if (login_button != null)
|
||||
login_button.onclick = login;
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
if (await client.isAuthentificate())
|
||||
{
|
||||
navigateTo("/home")
|
||||
return;
|
||||
}
|
||||
document.getElementById("button").onclick = login;
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
return `
|
||||
<div class=form>
|
||||
<label>Login</label>
|
||||
|
@ -30,15 +30,18 @@ export default class extends AbstractView {
|
||||
|
||||
async postInit()
|
||||
{
|
||||
let register_button = document.getElementById("button")
|
||||
if (register_button != null)
|
||||
register_button.onclick = register;
|
||||
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
if (client.isAuthentificate())
|
||||
{
|
||||
navigateTo("/home")
|
||||
return;
|
||||
}
|
||||
document.getElementById("button").onclick = register;
|
||||
}
|
||||
|
||||
async getHtml() {
|
||||
return `
|
||||
<div class=form>
|
||||
<label>Register</label>
|
||||
|
Loading…
Reference in New Issue
Block a user