Skip to content

Commit a3fcac0

Browse files
committed
Fix capabilities event listener
Using `once` here prevents the listeners from being called again after a reconnect, thus preventing successful reconnection.
1 parent e53d6c9 commit a3fcac0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/irc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,12 @@ export class Client extends (EventEmitter as unknown as new () => TypedEmitter<C
219219
if (opt.channelPrefixes) {
220220
this.state.supportedState.channel.types = opt.channelPrefixes;
221221
}
222-
this.state.capabilities.once('serverCapabilitesReady', () => {
222+
this.state.capabilities.on('serverCapabilitesReady', () => {
223223
this.onCapsList();
224224
// Flush on capabilities modified
225225
this.state.flush?.();
226226
})
227-
this.state.capabilities.once('userCapabilitesReady', () => {
227+
this.state.capabilities.on('userCapabilitesReady', () => {
228228
this.onCapsConfirmed();
229229
// Flush on capabilities modified
230230
this.state.flush?.();

0 commit comments

Comments
 (0)