Skip to content

Commit f676d5d

Browse files
committed
feat: don't recover state if channel manager doesn't exist
1 parent 1b04d37 commit f676d5d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

projects/stream-chat-angular/src/lib/channel.service.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,12 +1186,16 @@ export class ChannelService<
11861186
private handleNotification(clientEvent: ClientEvent<T>) {
11871187
switch (clientEvent.eventType) {
11881188
case 'connection.recovered': {
1189-
void this.recoverState().catch((error) =>
1190-
this.chatClientService.chatClient.logger(
1191-
'warn',
1192-
`Failed to recover state after connection recovery: ${error}`,
1193-
),
1194-
);
1189+
if (this.channelManager) {
1190+
void this.recoverState().catch((error) =>
1191+
this.chatClientService.chatClient.logger(
1192+
'warn',
1193+
`Failed to recover state after connection recovery: ${error}`,
1194+
),
1195+
);
1196+
} else {
1197+
this.reset();
1198+
}
11951199
break;
11961200
}
11971201
case 'user.updated': {

0 commit comments

Comments
 (0)