From 47857ec382654ad863f6e116311b09d12bb18b2c Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 9 Jun 2017 16:17:20 +0200 Subject: [PATCH] use cached pinned usage data --- www/common/toolbar2.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/common/toolbar2.js b/www/common/toolbar2.js index 8740606ee..813cef23c 100644 --- a/www/common/toolbar2.js +++ b/www/common/toolbar2.js @@ -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; };