[fix] Hide modal if an error occured at postinstall + adjust timeout

This commit is contained in:
Kload 2014-04-21 12:58:34 +02:00
parent a7565d7b15
commit 6f609894a3

View file

@ -94,7 +94,7 @@ app = Sammy('#main', function (sam) {
setInterval(function () { setInterval(function () {
installing = true; installing = true;
}, 2500); }, 1500);
$('#popup-title').text('Installing'); $('#popup-title').text('Installing');
$('#popup-body').html('<p>YunoHost is being installed on <strong>'+ data.domain +'</strong>. It may take a few minutes ...</p><br><div class="text-center"><img src="img/ajax-loader.gif"></div><br>'); $('#popup-body').html('<p>YunoHost is being installed on <strong>'+ data.domain +'</strong>. It may take a few minutes ...</p><br><div class="text-center"><img src="img/ajax-loader.gif"></div><br>');
@ -131,8 +131,10 @@ app = Sammy('#main', function (sam) {
}) })
.fail(function(xhr) { .fail(function(xhr) {
if (xhr.status == 401) { if (xhr.status == 401) {
$('#popup').modal('hide');
c.flash('fail', 'Wrong password'); c.flash('fail', 'Wrong password');
} else if (typeof xhr.responseJSON !== 'undefined') { } else if (typeof xhr.responseJSON !== 'undefined') {
$('#popup').modal('hide');
c.flash('fail', xhr.responseJSON.error); c.flash('fail', xhr.responseJSON.error);
} else { } else {
if (uri == '/postinstall') { if (uri == '/postinstall') {