Fixed a bug which prevented login in private mode (safari)

This commit is contained in:
Tobias Reich 2014-10-08 23:16:29 +02:00
parent 0780cab414
commit e10c087925
2 changed files with 12 additions and 3 deletions

View File

@ -119,13 +119,22 @@ var lychee = {
params = "login&user=" + user + "&password=" + password; params = "login&user=" + user + "&password=" + password;
lychee.api(params, function(data) { lychee.api(params, function(data) {
if (data===true) { if (data===true) {
localStorage.setItem("lychee_username", user);
// Use 'try' to catch a thrown error when Safari is in private mode
try { localStorage.setItem("lychee_username", user); }
window.location.reload(); window.location.reload();
} else { } else {
// Show error and reactive button
$("#password").val("").addClass("error").focus(); $("#password").val("").addClass("error").focus();
$(".message .button.active").removeClass("pressed"); $(".message .button.active").removeClass("pressed");
} }
}); });
}, },

File diff suppressed because one or more lines are too long