File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/components/ChannelList/hooks Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export const usePaginatedChannels = <
6161 const [ loadingNextPage , setLoadingNextPage ] = useState ( false ) ;
6262 const [ offset , setOffset ] = useState ( 0 ) ;
6363 const [ refreshing , setRefreshing ] = useState ( false ) ;
64- const lastRefresh = useRef ( new Date ( ) ) ;
64+ const lastRefresh = useRef ( new Date ( ) . getTime ( ) ) ;
6565
6666 const queryChannels = async (
6767 queryType = '' ,
@@ -122,14 +122,13 @@ export const usePaginatedChannels = <
122122
123123 const loadNextPage = hasNextPage ? queryChannels : undefined ;
124124 const refreshList = ( ) => {
125- const now = new Date ( ) ;
125+ const now = Date . now ( ) ;
126126 // Only allow pull-to-refresh 5 seconds after last successful refresh.
127- // @ts -ignore
128127 if ( now - lastRefresh . current < 5000 && ! error ) {
129128 return ;
130129 }
131130
132- lastRefresh . current = new Date ( ) ;
131+ lastRefresh . current = new Date ( ) . getTime ( ) ;
133132 return queryChannels ( 'refresh' ) ;
134133 } ;
135134
You can’t perform that action at this time.
0 commit comments