From e6ed9d4bb87fa3345920730e5ef49d3545278c4c Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Thu, 2 Mar 2017 16:36:56 +0100 Subject: [PATCH] Allow to make testnet the default peer by a cookie, for development purposes The cookie can be set from browser console like this: angular.element(document.body).injector().get('$cookies').put('peerStack', 'testnet') --- src/app/services/peers/peers.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/services/peers/peers.js b/src/app/services/peers/peers.js index 32a59af10..6fb508bcc 100644 --- a/src/app/services/peers/peers.js +++ b/src/app/services/peers/peers.js @@ -5,7 +5,7 @@ import './peer' const UPDATE_INTERVAL_CHECK = 10000 -app.factory('$peers', ($peer, $timeout) => { +app.factory('$peers', ($peer, $timeout, $cookies) => { class $peers { constructor () { this.stack = { @@ -38,7 +38,9 @@ app.factory('$peers', ($peer, $timeout) => { setActive () { this.active = _.chain([]) - .concat(this.stack.official, this.stack.public) + .concat($cookies.get('peerStack') == 'testnet' ? + this.stack.testnet : this.stack.official, + this.stack.public) .sample() .value()