From 9195c0cd12d691a462811a0790c0ffd59187a246 Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 26 Jun 2017 18:13:06 +0200 Subject: [PATCH] is isOverPinLimit in toolbar --- www/common/toolbar2.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/www/common/toolbar2.js b/www/common/toolbar2.js index 9b89e55ce..7378c13e2 100644 --- a/www/common/toolbar2.js +++ b/www/common/toolbar2.js @@ -664,13 +664,17 @@ define([ }); } }; - 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); } + + Cryptpad.isOverPinLimit(function (e, isOver, data) { + 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; };