Skip to content

Commit

Permalink
feat: don't recover state if channel manager doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Feb 28, 2025
1 parent 1b04d37 commit f676d5d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions projects/stream-chat-angular/src/lib/channel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1186,12 +1186,16 @@ export class ChannelService<
private handleNotification(clientEvent: ClientEvent<T>) {
switch (clientEvent.eventType) {
case 'connection.recovered': {
void this.recoverState().catch((error) =>
this.chatClientService.chatClient.logger(
'warn',
`Failed to recover state after connection recovery: ${error}`,
),
);
if (this.channelManager) {
void this.recoverState().catch((error) =>
this.chatClientService.chatClient.logger(
'warn',
`Failed to recover state after connection recovery: ${error}`,
),
);
} else {
this.reset();
}
break;
}
case 'user.updated': {
Expand Down

0 comments on commit f676d5d

Please sign in to comment.