mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-31 11:22:06 +00:00
Fixed: Prevent the update button from being double clicked for 5 seconds
This commit is contained in:
parent
0a1db9d071
commit
a1abcbcd40
2 changed files with 21 additions and 2 deletions
|
@ -12,5 +12,5 @@
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
|
|
||||||
[assembly: AssemblyVersion("2.0.0.1")]
|
[assembly: AssemblyVersion("10.0.0.*")]
|
||||||
[assembly: AssemblyFileVersion("10.0.0.*")]
|
[assembly: AssemblyFileVersion("10.0.0.*")]
|
||||||
|
|
|
@ -12,8 +12,27 @@ define(
|
||||||
'click .x-install-update': '_installUpdate'
|
'click .x-install-update': '_installUpdate'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
initialize: function () {
|
||||||
|
this.updating = false;
|
||||||
|
},
|
||||||
|
|
||||||
_installUpdate: function () {
|
_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);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue