allow pin limit caching to occur at api level

pull/1/head
ansuz 8 years ago
parent 3a9b480e4e
commit bb74935b08

@ -667,21 +667,7 @@ define([
}); });
} }
}; };
Cryptpad.isOverPinLimit(todo);
Cryptpad.isOverPinLimit(function (e, isOver, data) {
if (e) { return console.error(e); }
if (isOver) { return todo(void 0, true); }
if (!data) { return console.error("Problem creating limit"); }
var limit = data.limit;
var usage = data.usage;
if (typeof(limit) !== 'number' || typeof(usage) !== 'number') {
todo("invalid types");
} else if (Cryptpad.isLoggedIn() && usage >= limit) {
todo(void 0, true);
} else { todo(void 0, false); }
});
return $limit; return $limit;
}; };

Loading…
Cancel
Save