File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -284,16 +284,13 @@ const ChannelList = withChatContext(
284284 } ) ;
285285
286286 queryChannelsRequest = async ( filters , sort , options , retryCount = 1 ) => {
287- const channelPromise = this . props . client . queryChannels (
288- filters ,
289- sort ,
290- options ,
291- ) ;
292-
293287 let channelQueryResponse ;
294-
295288 try {
296- channelQueryResponse = await channelPromise ;
289+ channelQueryResponse = await this . props . client . queryChannels (
290+ filters ,
291+ sort ,
292+ options ,
293+ ) ;
297294 } catch ( e ) {
298295 // Wait for 2 seconds before making another attempt
299296 await this . wait ( 2000 ) ;
@@ -413,7 +410,8 @@ const ChannelList = withChatContext(
413410 options ,
414411 ) ;
415412
416- if ( options . offset === 0 && channelQueryResponse . length >= 1 ) {
413+ // Set the active channel only in case of reload.
414+ if ( queryType === 'reload' && channelQueryResponse . length >= 1 ) {
417415 this . props . setActiveChannel ( channelQueryResponse [ 0 ] ) ;
418416 }
419417
You can’t perform that action at this time.
0 commit comments