mirror of
https://github.com/fluencelabs/dweb-transports
synced 2025-04-25 14:52:18 +00:00
Gun: Fix bug on no data
This commit is contained in:
parent
7de53f74ca
commit
e13af1a495
@ -147,7 +147,7 @@ class TransportGUN extends Transport {
|
|||||||
let g = this.connection(url, verbose);
|
let g = this.connection(url, verbose);
|
||||||
if (!current) { // See TODO-GUN-CURRENT have to keep an extra copy to compare for which calls are new.
|
if (!current) { // See TODO-GUN-CURRENT have to keep an extra copy to compare for which calls are new.
|
||||||
g.once(data => {
|
g.once(data => {
|
||||||
this.monitored = Object.keys(data) || []; // Keep a copy - could actually just keep high water mark unless getting partial knowledge of state of array.
|
this.monitored = data ? Object.keys(data) : []; // Keep a copy - could actually just keep high water mark unless getting partial knowledge of state of array.
|
||||||
g.map().on((v, k) => {
|
g.map().on((v, k) => {
|
||||||
if (!(this.monitored.includes(k)) && (k !== '_')) { //See TODO-GUN-UNDERSCORE
|
if (!(this.monitored.includes(k)) && (k !== '_')) { //See TODO-GUN-UNDERSCORE
|
||||||
this.monitored.push(k)
|
this.monitored.push(k)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user