From 553559509613047dcdb7bef604a736a7123e862e Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 3 Feb 2021 13:32:53 +0100 Subject: [PATCH] Make sure we don't create multiple timeouts for the usage bar --- www/common/common-ui-elements.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 7fdc3e957..5d33f09ef 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1179,9 +1179,14 @@ define([ // getPinnedUsage updates common.account.usage, and other values // so we can just use those and only check for errors var $container = $('', {'class':'cp-limit-container'}); + var to; var todo = function (err, data) { + if (to) { + clearTimeout(to); + to = undefined; + } if (err === 'RPC_NOT_READY') { - setTimeout(function () { + to = setTimeout(function () { common.getPinUsage(teamId, todo); }, 1000); return;