Skip to content
Snippets Groups Projects
Commit 5598d5e7 authored by yamadapc's avatar yamadapc
Browse files

Try to fix network broadcast

parent 65130ecd
No related branches found
No related tags found
No related merge requests found
import Debug from 'debug'; import Debug from 'debug';
import EventEmitter from 'events'; import EventEmitter from 'events';
import Promise from 'bluebird'; import Promise from 'bluebird';
import cloneDeep from 'lodash/cloneDeep';
import isNode from 'detect-node'; import isNode from 'detect-node';
import methods from './methods'; import methods from './methods';
...@@ -35,7 +36,7 @@ class Steem extends EventEmitter { ...@@ -35,7 +36,7 @@ class Steem extends EventEmitter {
constructor(options = {}) { constructor(options = {}) {
super(options); super(options);
Object.assign(options, DEFAULTS); Object.assign(options, DEFAULTS);
this.options = options; this.options = cloneDeep(options);
this.id = 0; this.id = 0;
this.currentP = Promise.fulfilled(); this.currentP = Promise.fulfilled();
...@@ -96,7 +97,11 @@ class Steem extends EventEmitter { ...@@ -96,7 +97,11 @@ class Steem extends EventEmitter {
return Promise.map(Object.keys(this.apiIds), (name) => { return Promise.map(Object.keys(this.apiIds), (name) => {
debugSetup('Syncing API IDs', name); debugSetup('Syncing API IDs', name);
return this.getApiByNameAsync(name).then((result) => { return this.getApiByNameAsync(name).then((result) => {
this.apiIds[name] = result; if (result) {
this.apiIds[name] = result;
} else {
debugSetup('Dropped null API ID for', name);
}
}); });
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment