Fix issues with the async store

This commit is contained in:
yflory
2017-11-30 17:21:58 +01:00
parent b3688db202
commit 5c3237e093
8 changed files with 53 additions and 41 deletions

View File

@@ -571,12 +571,7 @@ define([
// getPinnedUsage updates common.account.usage, and other values
// so we can just use those and only check for errors
var $container = $('<span>', {'class':'cp-limit-container'});
var todo;
var updateUsage = Util.notAgainForAnother(function () {
common.getPinUsage(todo);
}, LIMIT_REFRESH_RATE);
todo = function (err, data) {
var todo = function (err, data) {
if (err) { return void console.error(err); }
var usage = data.usage;
@@ -645,6 +640,10 @@ define([
$limit.append($usage).append($text);
};
var updateUsage = Util.notAgainForAnother(function () {
common.getPinUsage(todo);
}, LIMIT_REFRESH_RATE);
setInterval(function () {
updateUsage();
}, LIMIT_REFRESH_RATE * 3);