From 183528cf7283ed35e09569a713874f2ebfff7416 Mon Sep 17 00:00:00 2001 From: vitorsemeano Date: Wed, 27 Feb 2019 22:05:53 +0000 Subject: [PATCH] added finally for request that made loading spin forever on start --- src/controllers/loginpage.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/controllers/loginpage.js b/src/controllers/loginpage.js index e6069f8e1..63fd42b1f 100644 --- a/src/controllers/loginpage.js +++ b/src/controllers/loginpage.js @@ -87,9 +87,23 @@ define(["appSettings", "dom", "connectionManager", "loading", "cardStyle", "emby }), view.addEventListener("viewshow", function(e) { loading.show(); var apiClient = getApiClient(); - apiClient.getPublicUsers().then(function(users) { - users.length ? users.length && users[0].EnableAutoLogin ? authenticateUserByName(view, apiClient, users[0].Name, "") : (showVisualForm(), loadUserList(view, apiClient, users)) : (view.querySelector("#txtManualName").value = "", showManualForm(view, !1, !1)), loading.hide() + apiClient.getPublicUsers().then(function(users) {debugger; + if (users.length) { + if (users[0].EnableAutoLogin) { + authenticateUserByName(view, apiClient, users[0].Name, ""); + } else { + showVisualForm(); + loadUserList(view, apiClient, users); + } + } else { + view.querySelector("#txtManualName").value = ""; + showManualForm(view, false, false); + } + + }).finally(function () { + loading.hide(); }); + apiClient.getJSON(apiClient.getUrl("Branding/Configuration")).then(function(options) { view.querySelector(".disclaimer").textContent = options.LoginDisclaimer || "" });