use cached pinned usage data

pull/1/head
ansuz 2017-06-09 16:17:20 +02:00
parent 08902c0910
commit 47857ec382
1 changed files with 7 additions and 1 deletions

View File

@ -626,7 +626,13 @@ define([
});
}
};
Cryptpad.isOverPinLimit(todo);
var limit = Cryptpad.account.limit;
var usage = Cryptpad.account.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;
};