Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/StreamrClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,18 @@ module.exports = class StreamrClient extends EventEmitter {
this.handleError(`Error subscribing to ${response.stream}: ${response.error}`)
} else {
const subs = this.subsByStream[response.stream]

// The typeof array === 'object'
if (subs && typeof subs === 'object') {
delete subs.subscribing
// Report subscribed to all non-resending Subscriptions for this stream
subs.filter((sub) => !sub.resending)
.forEach((sub) => {
sub.setState(Subscription.State.subscribed)
})
}

debug('Client subscribed: %o', response)

// Report subscribed to all non-resending Subscriptions for this stream
subs.filter((sub) => !sub.resending)
.forEach((sub) => {
sub.setState(Subscription.State.subscribed)
})
}
})

Expand Down