From 195de903e32001be02c04864059ac16de0230f22 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 4 Dec 2019 17:15:45 +0100 Subject: [PATCH] mkAsync getFileSize and getChannelList --- rpc.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpc.js b/rpc.js index e09ef7b17..8c7fe6c70 100644 --- a/rpc.js +++ b/rpc.js @@ -228,13 +228,15 @@ var truthyKeys = function (O) { }); }; -var getChannelList = function (Env, publicKey, cb) { +var getChannelList = function (Env, publicKey, _cb) { + var cb = Util.once(Util.mkAsync(_cb)); loadUserPins(Env, publicKey, function (pins) { cb(truthyKeys(pins)); }); }; -var getFileSize = function (Env, channel, cb) { +var getFileSize = function (Env, channel, _cb) { + var cb = Util.once(Util.mkAsync(_cb)); if (!isValidId(channel)) { return void cb('INVALID_CHAN'); } if (channel.length === 32) { if (typeof(Env.msgStore.getChannelSize) !== 'function') {