Skip to content

Commit

Permalink
Merge pull request #12 from vincevd1/fix_members_showing_up_twice
Browse files Browse the repository at this point in the history
LGTM
  • Loading branch information
vincevd1 authored May 23, 2024
2 parents a60d641 + b4d5993 commit 27d51a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/components/members/memberlist.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function MemberList({ search }: { search: string }) {

async function getMemberList() {
let newMembers: Members = {} as Members;

if (!isFetching) return;
try {
// is there a next link then load it, if not but there are no members loaded yet this is the first load, load them otherwise there are no more members to load.
if (next) {
Expand Down Expand Up @@ -45,6 +45,7 @@ export default function MemberList({ search }: { search: string }) {
}

useEffect(() => {
setIsFetching(true);
getMemberList();
window.addEventListener('scroll', handleScroll)
return () => window.removeEventListener('scroll', handleScroll);
Expand Down

0 comments on commit 27d51a9

Please sign in to comment.