From 1a7193e113b219619cdce7ae8d22810e9f4d24b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 22 Jun 2015 16:55:32 +0200 Subject: [PATCH] System commands with ignore set to true also ignore http errors --- src/octoprint/static/js/app/viewmodels/navigation.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/navigation.js b/src/octoprint/static/js/app/viewmodels/navigation.js index ee8a4065..c9f3b9b1 100644 --- a/src/octoprint/static/js/app/viewmodels/navigation.js +++ b/src/octoprint/static/js/app/viewmodels/navigation.js @@ -28,15 +28,17 @@ $(function() { new PNotify({title: "Success", text: _.sprintf(gettext("The command \"%(command)s\" executed successfully"), {command: action.name}), type: "success"}); }, error: function(jqXHR, textStatus, errorThrown) { - var error = "

" + _.sprintf(gettext("The command \"%(command)s\" could not be executed."), {command: action.name}) + "

"; - error += pnotifyAdditionalInfo("
" + jqXHR.responseText + "
"); - new PNotify({title: gettext("Error"), text: error, type: "error", hide: false}); + if (!action.hasOwnProperty("ignore") || !action.ignore) { + var error = "

" + _.sprintf(gettext("The command \"%(command)s\" could not be executed."), {command: action.name}) + "

"; + error += pnotifyAdditionalInfo("
" + jqXHR.responseText + "
"); + new PNotify({title: gettext("Error"), text: error, type: "error", hide: false}); + } } }) }; if (action.confirm) { showConfirmationDialog(action.confirm, function (e) { - callback(); + callback(); }); } else { callback(); @@ -49,4 +51,4 @@ $(function() { ["loginStateViewModel", "appearanceViewModel", "settingsViewModel", "userSettingsViewModel"], "#navbar" ]); -}); \ No newline at end of file +});