File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
projects/stream-chat-angular/src/lib Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -250,6 +250,30 @@ export class ChatClientService<
250250 } ) ;
251251 }
252252 }
253+ if ( typeof e . unread_channels !== 'undefined' ) {
254+ let user : OwnUserResponse < T > | UserResponse < T > | undefined ;
255+ this . userSubject . pipe ( take ( 1 ) ) . subscribe ( ( u ) => {
256+ user = u ;
257+ } ) ;
258+ if ( user && user . unread_channels !== e . unread_channels ) {
259+ this . userSubject . next ( {
260+ ...user ,
261+ unread_channels : e . unread_channels ,
262+ } ) ;
263+ }
264+ }
265+ if ( typeof e . unread_count !== 'undefined' ) {
266+ let user : OwnUserResponse < T > | UserResponse < T > | undefined ;
267+ this . userSubject . pipe ( take ( 1 ) ) . subscribe ( ( u ) => {
268+ user = u ;
269+ } ) ;
270+ if ( user && user . unread_count !== e . unread_count ) {
271+ this . userSubject . next ( {
272+ ...user ,
273+ unread_count : e . unread_count ,
274+ } ) ;
275+ }
276+ }
253277 if (
254278 e . type === 'user.updated' &&
255279 this . chatClient . user &&
You can’t perform that action at this time.
0 commit comments