File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
projects/stream-chat-angular/src/lib Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -766,7 +766,7 @@ describe('ChannelService', () => {
766766 expect ( channel . on ) . toHaveBeenCalledWith ( jasmine . any ( Function ) ) ;
767767 } ) ) ;
768768
769- it ( `shouldn't add channels duplicated if two notification event is received for the same channel` , fakeAsync ( async ( ) => {
769+ it ( `shouldn't add channels twice if two notification events were received for the same channel` , fakeAsync ( async ( ) => {
770770 await init ( ) ;
771771 const channel = generateMockChannels ( ) [ 0 ] ;
772772 channel . cid = 'channel' ;
Original file line number Diff line number Diff line change @@ -273,11 +273,8 @@ export class ChannelService<
273273 const deletedChannels = currentChannels . filter (
274274 ( c ) => ! channels ?. find ( ( channel ) => channel . cid === c . cid )
275275 ) ;
276- this . addChannelsFromNotification ( newChannels as ChannelResponse < T > [ ] ) ;
276+ void this . addChannelsFromNotification ( newChannels as ChannelResponse < T > [ ] ) ;
277277 this . removeChannelsFromChannelList ( deletedChannels . map ( ( c ) => c . cid ) ) ;
278- if ( ! newChannels . length && ! deletedChannels . length ) {
279- this . channelsSubject . next ( channels as Channel < T > [ ] ) ;
280- }
281278 } ;
282279
283280 private messageListSetter = ( messages : StreamMessage < T > [ ] ) => {
@@ -866,13 +863,13 @@ export class ChannelService<
866863
867864 private handleNewMessageNotification ( clientEvent : ClientEvent < T > ) {
868865 if ( clientEvent . event . channel ) {
869- this . addChannelsFromNotification ( [ clientEvent . event . channel ] ) ;
866+ void this . addChannelsFromNotification ( [ clientEvent . event . channel ] ) ;
870867 }
871868 }
872869
873870 private handleAddedToChannelNotification ( clientEvent : ClientEvent < T > ) {
874871 if ( clientEvent . event . channel ) {
875- this . addChannelsFromNotification ( [ clientEvent . event . channel ] ) ;
872+ void this . addChannelsFromNotification ( [ clientEvent . event . channel ] ) ;
876873 }
877874 }
878875
You can’t perform that action at this time.
0 commit comments