diff --git a/frontend/static/js/views/accounts/LoginView.js b/frontend/static/js/views/accounts/LoginView.js index b9a6621..b751328 100644 --- a/frontend/static/js/views/accounts/LoginView.js +++ b/frontend/static/js/views/accounts/LoginView.js @@ -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 `
diff --git a/frontend/static/js/views/accounts/RegisterView.js b/frontend/static/js/views/accounts/RegisterView.js index 1616050..7fe2cef 100644 --- a/frontend/static/js/views/accounts/RegisterView.js +++ b/frontend/static/js/views/accounts/RegisterView.js @@ -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 `