Fix stupid / buggy error handling for postinstall

This commit is contained in:
Alexandre Aubin 2019-08-13 00:46:45 +02:00
parent b760316218
commit b97ef045e8
2 changed files with 3 additions and 8 deletions

View file

@ -102,9 +102,9 @@
var args = data; var args = data;
// TODO: change this code // TODO: change this code
if (uri === '/postinstall') { if (uri === '/postinstall') {
var installing = false; var post_installing = false;
setInterval(function () { setInterval(function () {
installing = true; post_installing = true;
}, 1500); }, 1500);
} }
@ -112,8 +112,7 @@
callbackOnFailure = function(xhr) { callbackOnFailure = function(xhr) {
// Postinstall is a custom case, we have to wait that // Postinstall is a custom case, we have to wait that
// operation is done before doing anything // operation is done before doing anything
if (uri === '/postinstall') { if ((uri === '/postinstall') && (post_installing)) {
if (installing) {
interval = window.location.hostname === args.domain ? 20000 : 5000; interval = window.location.hostname === args.domain ? 20000 : 5000;
checkInstall = setInterval(function () { checkInstall = setInterval(function () {
c.checkInstall(function(isInstalled) { c.checkInstall(function(isInstalled) {
@ -124,9 +123,6 @@
} }
}); });
}, interval); }, interval);
} else {
c.flash('fail', y18n.t('error_occured'));
}
} }
// Regular errors // Regular errors
else { else {

View file

@ -141,7 +141,6 @@
"enable": "Enable", "enable": "Enable",
"enabled": "Enabled", "enabled": "Enabled",
"error_modify_something": "You should modify something", "error_modify_something": "You should modify something",
"error_occured": "An error occurred, try again",
"error_retrieve_feed": "Could not retrieve feed: %s. You might have a plugin prevent your browser from performing this request (or the website is down).", "error_retrieve_feed": "Could not retrieve feed: %s. You might have a plugin prevent your browser from performing this request (or the website is down).",
"error_select_domain": "You should indicate a domain", "error_select_domain": "You should indicate a domain",
"error_server": "Server error", "error_server": "Server error",