File tree Expand file tree Collapse file tree 2 files changed +1
-6
lines changed Expand file tree Collapse file tree 2 files changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -40,25 +40,21 @@ export const fetchUsers = async (tabId, page = 1) => {
40
40
if ( newUsers . length > 0 ) {
41
41
if ( page === 1 ) {
42
42
usersData [ tabId ] = newUsers ; // Initial load
43
- console . log ( 'Fetched initial users' ) ;
44
43
} else {
45
44
const existingIds = new Set ( usersData [ tabId ] . map ( ( user ) => user . id ) ) ;
46
45
const uniqueNewUsers = newUsers . filter (
47
46
( user ) => ! existingIds . has ( user . id ) ,
48
47
) ;
49
48
usersData [ tabId ] = [ ...usersData [ tabId ] , ...uniqueNewUsers ] ;
50
- console . log ( 'Fetched more users' ) ;
51
- console . log ( usersData [ tabId ] ) ;
52
49
}
53
50
currentPage = page ;
54
- rerender ( App ( ) , document . getElementById ( 'root' ) ) ;
55
51
} else {
56
- console . log ( 'No more users to fetch' ) ;
57
52
}
58
53
} catch ( error ) {
59
54
console . error ( 'Error fetching users' , error ) ;
60
55
} finally {
61
56
isLoading = false ;
57
+ rerender ( App ( ) , document . getElementById ( 'root' ) ) ;
62
58
}
63
59
} ;
64
60
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ export const UsersSection = ({
22
22
window . addEventListener (
23
23
'scroll' ,
24
24
debounce ( ( ) => {
25
- console . log ( 'scroll triggered' ) ;
26
25
if ( window . innerHeight + window . scrollY >= document . body . offsetHeight ) {
27
26
fetchUsers ( activeTab , currentPage + 1 ) ;
28
27
}
You can’t perform that action at this time.
0 commit comments