File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
src/smart-components/ChannelList/components Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import * as channelListActions from '../../dux/actionTypes';
1414import useSendbirdStateContext from '../../../../hooks/useSendbirdStateContext' ;
1515import EditUserProfile from '../../../EditUserProfile' ;
1616import PlaceHolder , { PlaceHolderTypes } from '../../../../ui/PlaceHolder' ;
17+ import { isAboutSame } from '../utils' ;
1718
1819const DELIVERY_RECIPT = 'delivery_receipt' ;
1920
@@ -126,7 +127,7 @@ const ChannelListUI: React.FC<ChannelListUIProps> = (props: ChannelListUIProps)
126127 className = "sendbird-channel-list__body"
127128 onScroll = { ( e ) => {
128129 const target = e ?. target as HTMLDivElement ;
129- const fetchMore = target . clientHeight + target . scrollTop === target . scrollHeight ;
130+ const fetchMore = isAboutSame ( target . clientHeight + target . scrollTop , target . scrollHeight , 10 ) ;
130131 if ( fetchMore && channelSource ?. hasNext ) {
131132 logger . info ( 'ChannelList: Fetching more channels' ) ;
132133 channelListDispatcher ( {
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ export const isSuperGroupChannelEnabled = (sdk = {}) => {
3838 return false ;
3939} ;
4040
41+ export const isAboutSame = ( a , b , px ) => ( Math . abs ( a - b ) <= px ) ;
42+
4143export const setChannelType = ( params , type ) => {
4244 if ( type === 'broadcast' ) {
4345 // eslint-disable-next-line no-param-reassign
You can’t perform that action at this time.
0 commit comments