Skip to content

Commit 31a8a1b

Browse files
Ishan VeerIshan Veer
authored andcommitted
fixed loading psinner issue
1 parent 9162eaa commit 31a8a1b

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

users/discord/App.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,21 @@ export const fetchUsers = async (tabId, page = 1) => {
4040
if (newUsers.length > 0) {
4141
if (page === 1) {
4242
usersData[tabId] = newUsers; // Initial load
43-
console.log('Fetched initial users');
4443
} else {
4544
const existingIds = new Set(usersData[tabId].map((user) => user.id));
4645
const uniqueNewUsers = newUsers.filter(
4746
(user) => !existingIds.has(user.id),
4847
);
4948
usersData[tabId] = [...usersData[tabId], ...uniqueNewUsers];
50-
console.log('Fetched more users');
51-
console.log(usersData[tabId]);
5249
}
5350
currentPage = page;
54-
rerender(App(), document.getElementById('root'));
5551
} else {
56-
console.log('No more users to fetch');
5752
}
5853
} catch (error) {
5954
console.error('Error fetching users', error);
6055
} finally {
6156
isLoading = false;
57+
rerender(App(), document.getElementById('root'));
6258
}
6359
};
6460

users/discord/components/UsersSection.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export const UsersSection = ({
2222
window.addEventListener(
2323
'scroll',
2424
debounce(() => {
25-
console.log('scroll triggered');
2625
if (window.innerHeight + window.scrollY >= document.body.offsetHeight) {
2726
fetchUsers(activeTab, currentPage + 1);
2827
}

0 commit comments

Comments
 (0)