Don't store a pad in the drive if the limit has been reached

This commit is contained in:
yflory
2017-04-28 12:01:47 +02:00
parent bf7c7c45d0
commit a165332c15
11 changed files with 58 additions and 26 deletions

View File

@@ -497,19 +497,15 @@ define([
'class': LIMIT_ELEM_CLS,
'title': Messages.pinLimitReached
}).append($limitIcon).hide().appendTo($userContainer);
var andThen = function (e, limit) {
if (usage > limit) {
var todo = function (e, overLimit) {
if (e) { return void console.error("Unable tog et the pinned usage"); }
if (overLimit) {
$limit.show().click(function () {
Cryptpad.alert(Messages.pinLimitReachedAlert, null, true);
});
}
};
var todo = function (e, used) {
usage = Cryptpad.bytesToMegabytes(used);
if (e) { console.error("Unable tog et the pinned usage"); return; }
Cryptpad.getPinLimit(andThen);
};
Cryptpad.getPinnedUsage(todo);
Cryptpad.isOverPinLimit(todo);
}
if (config.displayed.indexOf('newpad') !== -1) {