From 53bb6254fd4c420925b0c8c6c2e352c1d483a7bb Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Tue, 28 May 2013 22:03:43 -0700 Subject: [PATCH] removed some false/positive error message from the UI. --- UI/Instrumentation/ErrorHandler.js | 3 ++- UI/Shared/Toolbar/Button/ButtonView.js | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/UI/Instrumentation/ErrorHandler.js b/UI/Instrumentation/ErrorHandler.js index f24114dd0..bef3412e1 100644 --- a/UI/Instrumentation/ErrorHandler.js +++ b/UI/Instrumentation/ErrorHandler.js @@ -68,7 +68,8 @@ }; if (xmlHttpRequest.status === 0 && xmlHttpRequest.readyState === 0) { - message.message = 'NzbDrone Server Not Reachable. make sure NzbDrone is running.'; + return false; + //message.message = 'NzbDrone Server Not Reachable. make sure NzbDrone is running.'; } else { message.message = "[{0}] {1} : {2}".format(ajaxOptions.type, xmlHttpRequest.statusText, ajaxOptions.url); } diff --git a/UI/Shared/Toolbar/Button/ButtonView.js b/UI/Shared/Toolbar/Button/ButtonView.js index a3fc6095a..ba04c772a 100644 --- a/UI/Shared/Toolbar/Button/ButtonView.js +++ b/UI/Shared/Toolbar/Button/ButtonView.js @@ -52,7 +52,10 @@ define(['app', 'Config', 'Commands/CommandController', 'Shared/Messenger'], func } }); - commandPromise.fail(function () { + commandPromise.fail(function (options) { + if (options.readyState === 0 || options.status === 0) { + return; + } if (self.model.get('errorMessage')) { NzbDrone.Shared.Messenger.show({ message: self.model.get('errorMessage'), @@ -62,9 +65,11 @@ define(['app', 'Config', 'Commands/CommandController', 'Shared/Messenger'], func }); commandPromise.always(function () { - self.$el.removeClass('disabled'); - self.ui.icon.removeClass('icon-spinner icon-spin'); - self.idle = true; + if (!self.isClosed) { + self.$el.removeClass('disabled'); + self.ui.icon.removeClass('icon-spinner icon-spin'); + self.idle = true; + } }); } },