From c45adca02f57e916d0bb65bfc702b011efd132d6 Mon Sep 17 00:00:00 2001 From: kload Date: Sun, 25 May 2014 21:36:34 +0000 Subject: [PATCH] [fix] CheckInstall --- js/app.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/js/app.js b/js/app.js index 856cdaf9..6e7332c4 100644 --- a/js/app.js +++ b/js/app.js @@ -222,17 +222,18 @@ app = Sammy('#main', function (sam) { } else { if (uri == '/postinstall') { if (installing) { - setInterval(function () { - if (window.location.hostname === args.domain) { - document.location.href = 'https://'+ args.domain +'/yunohost/admin'; - } else { - c.checkInstall(function(isInstalled) { - if (isInstalled) { - c.flash('success', y18n.t('installation_complete')); + checkInstall = setInterval(function () { + c.checkInstall(function(isInstalled) { + if (isInstalled) { + c.flash('success', y18n.t('installation_complete')); + clearInterval(checkInstall); + if (window.location.hostname === args.domain) { + document.location.href = 'https://'+ args.domain +'/yunohost/admin'; + } else { c.redirect('#/login'); } - }); - } + } + }); }, 5000); } else { c.flash('fail', y18n.t('error_occured'));