From 2a6b255aee782adab2ba36829c6599a9a3fcdc72 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 4 Nov 2017 19:16:30 +0200 Subject: [PATCH] Make sign in work --- client/js/socket-events/auth.js | 7 +++++-- client/views/index.js | 1 - client/views/windows/loading.html | 13 ------------- client/views/windows/{sign_in.html => sign_in.tpl} | 0 4 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 client/views/windows/loading.html rename client/views/windows/{sign_in.html => sign_in.tpl} (100%) diff --git a/client/js/socket-events/auth.js b/client/js/socket-events/auth.js index e544948f..80fd0e18 100644 --- a/client/js/socket-events/auth.js +++ b/client/js/socket-events/auth.js @@ -4,6 +4,7 @@ const $ = require("jquery"); const socket = require("../socket"); const storage = require("../localStorage"); const utils = require("../utils"); +const templates = require("../../views"); socket.on("auth", function(data) { // If we reconnected and serverHash differs, that means the server restarted @@ -17,11 +18,13 @@ socket.on("auth", function(data) { utils.serverHash = data.serverHash; - const login = $("#sign-in"); let token; const user = storage.get("user"); - login.find(".btn").prop("disabled", false); + const login = $("#sign-in") + .html(templates.windows.sign_in()) + .find(".btn") + .prop("disabled", false); if (!data.success) { if (login.length === 0) { diff --git a/client/views/index.js b/client/views/index.js index 8fd3dc2c..a459ded1 100644 --- a/client/views/index.js +++ b/client/views/index.js @@ -21,7 +21,6 @@ module.exports = { }, windows: { - loading: require("./windows/loading.tpl"), sign_in: require("./windows/sign_in.tpl"), }, diff --git a/client/views/windows/loading.html b/client/views/windows/loading.html deleted file mode 100644 index 105507ae..00000000 --- a/client/views/windows/loading.html +++ /dev/null @@ -1,13 +0,0 @@ -
-
-

The Lounge is loading…

-
-
-

Loading the app… Make sure to have JavaScript enabled.

-
-

This is taking longer than it should, there might be connectivity issues.

- -
- -
-
diff --git a/client/views/windows/sign_in.html b/client/views/windows/sign_in.tpl similarity index 100% rename from client/views/windows/sign_in.html rename to client/views/windows/sign_in.tpl