Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Allow to make testnet the default peer
Browse files Browse the repository at this point in the history
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')
  • Loading branch information
Vit Stanislav authored and Vit Stanislav committed Mar 2, 2017
1 parent 8dd7576 commit e6ed9d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/services/peers/peers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit e6ed9d4

Please sign in to comment.