From 83f6a29f15ca34be0c64f7729f961e5b36ff2773 Mon Sep 17 00:00:00 2001 From: ClemDee Date: Thu, 25 Jul 2019 14:50:46 +0200 Subject: [PATCH 1/3] Disallow to click more than once on the button to store a shared pad in drive --- www/common/common-ui-elements.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 207d00336..4f00ce589 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2766,7 +2766,7 @@ define([ UIElements.displayCrowdfunding(common); modal.delete(); }); - $(store).click(function () { + $(store).one("click", function () { common.getSframeChannel().query("Q_AUTOSTORE_STORE", null, function (err, obj) { var error = err || (obj && obj.error); if (error) { From 55d53cfac67b740fb6eb1cf79530efc9715465da Mon Sep 17 00:00:00 2001 From: ClemDee Date: Thu, 8 Aug 2019 16:42:21 +0200 Subject: [PATCH 2/3] Prevent blocking UI if user disconnected --- www/common/common-ui-elements.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 4f00ce589..39fea504a 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2766,8 +2766,12 @@ define([ UIElements.displayCrowdfunding(common); modal.delete(); }); - $(store).one("click", function () { + var waitingForStoringCb = true; + $(store).click(function () { + if (waitingForStoringCb) { return; } + waitingForStoringCb = true; common.getSframeChannel().query("Q_AUTOSTORE_STORE", null, function (err, obj) { + waitingForStoringCb = false; var error = err || (obj && obj.error); if (error) { if (error === 'E_OVER_LIMIT') { From eaae63f275dd726f2ed982cd6c410f2c71c6701d Mon Sep 17 00:00:00 2001 From: ClemDee Date: Thu, 8 Aug 2019 17:21:00 +0200 Subject: [PATCH 3/3] Correct stupid error --- www/common/common-ui-elements.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 39fea504a..8bd3574c0 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -2766,7 +2766,7 @@ define([ UIElements.displayCrowdfunding(common); modal.delete(); }); - var waitingForStoringCb = true; + var waitingForStoringCb = false; $(store).click(function () { if (waitingForStoringCb) { return; } waitingForStoringCb = true;