fix error in pin reset
This commit is contained in:
7
rpc.js
7
rpc.js
@@ -583,9 +583,10 @@ var resetUserPins = function (Env, publicKey, channelList, cb) {
|
|||||||
if (e) { return void cb(e); }
|
if (e) { return void cb(e); }
|
||||||
var pinSize = sumChannelSizes(sizes);
|
var pinSize = sumChannelSizes(sizes);
|
||||||
|
|
||||||
getFreeSpace(Env, publicKey, function (e, free) {
|
|
||||||
|
getLimit(Env, publicKey, function (e, limit) {
|
||||||
if (e) {
|
if (e) {
|
||||||
WARN('getFreeSpace', e);
|
WARN('[RESET_ERR]', e);
|
||||||
return void cb(e);
|
return void cb(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,7 +598,7 @@ var resetUserPins = function (Env, publicKey, channelList, cb) {
|
|||||||
|
|
||||||
They will not be able to pin additional pads until they upgrade
|
They will not be able to pin additional pads until they upgrade
|
||||||
or delete enough files to go back under their limit. */
|
or delete enough files to go back under their limit. */
|
||||||
if (pinSize > free && session.hasPinned) { return void(cb('E_OVER_LIMIT')); }
|
if (pinSize > limit && session.hasPinned) { return void(cb('E_OVER_LIMIT')); }
|
||||||
pinStore.message(publicKey, JSON.stringify(['RESET', channelList]),
|
pinStore.message(publicKey, JSON.stringify(['RESET', channelList]),
|
||||||
function (e) {
|
function (e) {
|
||||||
if (e) { return void cb(e); }
|
if (e) { return void cb(e); }
|
||||||
|
|||||||
Reference in New Issue
Block a user