From afb0061d7bbf796a8da8b572f6a6fb772d4652a9 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 28 Apr 2017 17:11:07 +0200 Subject: [PATCH] Fix an issue with anonymous user unable to store new pads --- www/common/cryptpad-common.js | 3 ++- www/common/userObject.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index a2d2f5aaf..6d51c999c 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -574,7 +574,7 @@ define([ if (!contains) { var data = makePad(href, name); - getStore().pushData(data, function (e, state) { + getStore().pushData(data, function (e) { if (e) { if (e === 'E_OVER_LIMIT') { common.alert(Messages.pinLimitNotPinned, null, true); @@ -725,6 +725,7 @@ define([ }; var isOverPinLimit = common.isOverPinLimit = function (cb) { + if (!common.isLoggedIn()) { return void cb(null, false); } var usage; var andThen = function (e, limit) { if (e) { return void cb(e); } diff --git a/www/common/userObject.js b/www/common/userObject.js index 0acb44c68..8ce772f50 100644 --- a/www/common/userObject.js +++ b/www/common/userObject.js @@ -434,7 +434,7 @@ define([ files[FILES_DATA].push(data); cb(); }; - if (!Cryptpad.isLoggedIn() || !AppConfig.enablePinning) { todo(); } + if (!Cryptpad.isLoggedIn() || !AppConfig.enablePinning) { return void todo(); } Cryptpad.pinPads([Cryptpad.hrefToHexChannelId(data.href)], function (e, hash) { if (e) { return void cb(e); } todo();