Issue #30 : Avoid displaying "undefined" for username when it was not yet stored in the localStorage
This commit is contained in:
parent
568ca8005d
commit
cc88b341b2
1 changed files with 8 additions and 2 deletions
10
js/Login.js
10
js/Login.js
|
@ -124,8 +124,14 @@ Login.prototype.authenticate = function(e) {
|
|||
};
|
||||
|
||||
Login.prototype.fillLoginFormFromLocalStorage = function() {
|
||||
$("#url").value = localStorage.server_url;
|
||||
$("#un").value = localStorage.username;
|
||||
var serverUrl = localStorage.server_url;
|
||||
if (serverUrl) {
|
||||
$("#url").value = serverUrl;
|
||||
}
|
||||
var userName = localStorage.username;
|
||||
if (userName) {
|
||||
$("#un").value = userName;
|
||||
}
|
||||
var backendName = localStorage.backend;
|
||||
if (backendName === "TinyTinyRSS") {
|
||||
$("#login form").backend[0].checked = true;
|
||||
|
|
Reference in a new issue