From bd9efd7c045fdec74995e323201cdc2652bb39b1 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 15 Mar 2017 15:56:32 +0100 Subject: [PATCH] provide examples of valid and invalid rpc calls --- www/examples/rpc/main.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/www/examples/rpc/main.js b/www/examples/rpc/main.js index 528290d66..37b1751d7 100644 --- a/www/examples/rpc/main.js +++ b/www/examples/rpc/main.js @@ -30,6 +30,20 @@ define([ if (e) { return void console.error(e); } console.log(msg); }); + + var list = Cryptpad.getUserChannelList(); + if (list.length) { + rpc.send('GET_FILE_SIZE', list[0], function (e, msg) { + if (e) { + return void console.error(e); + } + console.log(msg); + }); + } + rpc.send('GET_FILE_SIZE', 'pewpew', function (e, msg) { + if (e) { return void console.error(e); } + console.log(msg); + }); }); }); });