We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 347ff4b commit e48d529Copy full SHA for e48d529
lib/connection.ts
@@ -297,10 +297,11 @@ export class Connection {
297
subscribe: () => this.subscribeMessage(callback, subscribeMessage),
298
unsubscribe: async () => {
299
// No need to unsubscribe if we're disconnected
300
- if (!this.connected) {
301
- return;
+ if (this.connected) {
+ await this.sendMessagePromise(
302
+ messages.unsubscribeEvents(commandId)
303
+ );
304
}
- await this.sendMessagePromise(messages.unsubscribeEvents(commandId));
305
this.commands.delete(commandId);
306
},
307
};
0 commit comments