From bc0a5b9597d32b1f457079b7ec1795aeadeb28e8 Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Sun, 22 May 2016 17:35:42 +0300 Subject: [PATCH] fix double BTC bug in ssu when configuring currencies --- bin/ssu | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/ssu b/bin/ssu index fcdbcd9d..bd8b2d7a 100755 --- a/bin/ssu +++ b/bin/ssu @@ -145,6 +145,10 @@ function cryptoActivate (code, on) { .then(function (data) { var config = data.data if (on) { + if (R.contains(code, config.exchanges.settings.coins)) { + console.log('success [no changes]') + process.exit(0) + } config.exchanges.settings.coins = R.append(code, config.exchanges.settings.coins) } else { config.exchanges.settings.coins = R.without([code], config.exchanges.settings.coins) @@ -195,7 +199,7 @@ function crypto () { transfer: walletPlugin, trader: traderPlugin } - config.exchanges.settings.coins = ['BTC', code] + config.exchanges.settings.coins = R.union(config.exchanges.settings.coins, [code]) db.none('update user_config set data=$1 where type=$2', [config, 'exchanges']) db.none('notify "config_update"') })