mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-05-09 13:57:59 +00:00
Resubscribe on reconnect
This commit is contained in:
@@ -7,4 +7,4 @@ import * as FeedMessage from './feed';
|
||||
|
||||
export { Types, FeedMessage };
|
||||
|
||||
export const VERSION: Types.FeedVersion = 1 as Types.FeedVersion;
|
||||
export const VERSION: Types.FeedVersion = 2 as Types.FeedVersion;
|
||||
|
||||
@@ -72,6 +72,12 @@ export class Connection {
|
||||
status: 'online',
|
||||
nodes: new Map()
|
||||
});
|
||||
|
||||
// Re-subscribe to previously selected chain
|
||||
if (this.state.subscribed) {
|
||||
this.subscribe(this.state.subscribed);
|
||||
}
|
||||
|
||||
this.socket.addEventListener('message', this.handleMessages);
|
||||
this.socket.addEventListener('close', this.handleDisconnect);
|
||||
this.socket.addEventListener('error', this.handleDisconnect);
|
||||
|
||||
Reference in New Issue
Block a user