From a1abcbcd40771a957bb5adb1fa774b41d5b062e2 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 16 May 2014 08:47:53 -0700 Subject: [PATCH] Fixed: Prevent the update button from being double clicked for 5 seconds --- .../Properties/AssemblyInfo.cs | 2 +- src/UI/System/Update/UpdateItemView.js | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Common/Properties/AssemblyInfo.cs b/src/NzbDrone.Common/Properties/AssemblyInfo.cs index 71f440bc5..e9f498cc8 100644 --- a/src/NzbDrone.Common/Properties/AssemblyInfo.cs +++ b/src/NzbDrone.Common/Properties/AssemblyInfo.cs @@ -12,5 +12,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("10.0.0.*")] [assembly: AssemblyFileVersion("10.0.0.*")] diff --git a/src/UI/System/Update/UpdateItemView.js b/src/UI/System/Update/UpdateItemView.js index 362b76690..d51ddb19a 100644 --- a/src/UI/System/Update/UpdateItemView.js +++ b/src/UI/System/Update/UpdateItemView.js @@ -12,8 +12,27 @@ define( 'click .x-install-update': '_installUpdate' }, + initialize: function () { + this.updating = false; + }, + _installUpdate: function () { - CommandController.Execute('installUpdate', { updatePackage: this.model.toJSON() }); + if (this.updating) { + return; + } + + this.updating = true; + var self = this; + + var promise = CommandController.Execute('installUpdate', { updatePackage: this.model.toJSON() }); + + promise.done(function () { + window.setTimeout(function () { + self.updating = false; + }, 5000); + }); + + } }); });