From 7230ee71a8ec8294e76c10089367180575cf4ff7 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 18 Sep 2019 16:31:23 +0200 Subject: [PATCH] fix json.sortify in browser contexts. lint compliance --- scripts/tests/test-rpc.js | 2 +- www/common/outer/roster.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/tests/test-rpc.js b/scripts/tests/test-rpc.js index 1afcd0b7d..d6f8053f9 100644 --- a/scripts/tests/test-rpc.js +++ b/scripts/tests/test-rpc.js @@ -400,7 +400,7 @@ nThen(function (w) { if (err) { return void console.log(err); } console.log("STATE =", JSON.stringify(oscar.roster.getState(), null, 2)); })); -}).nThen(function (w) { +}).nThen(function () { diff --git a/www/common/outer/roster.js b/www/common/outer/roster.js index e4699d077..bbf014215 100644 --- a/www/common/outer/roster.js +++ b/www/common/outer/roster.js @@ -493,7 +493,7 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) { // commands roster.checkpoint = function (_cb) { var cb = Util.once(Util.mkAsync(_cb)); - var state = ref.state; + //var state = ref.state; //if (!state) { return cb("UNINITIALIZED"); } send([ 'CHECKPOINT', ref.state], cb); }; @@ -626,11 +626,12 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) { require("../../bower_components/chainpad-crypto/crypto") ); } else if ((typeof(define) !== 'undefined' && define !== null) && (define.amd !== null)) { + require.config({ paths: { 'json.sortify': '/bower_components/json.sortify/dist/JSON.sortify' } }); define([ '/common/common-util.js', '/common/common-hash.js', '/bower_components/chainpad-netflux/chainpad-netflux.js', - '/bower_compoents/json.sortify/dist/JSON.sortify.js', + 'json.sortify', '/bower_components/nthen/index.js', '/bower_components/chainpad-crypto/crypto.js' //'/bower_components/tweetnacl/nacl-fast.min.js',