diff --git a/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal-list.tsx b/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal-list.tsx index b760351c..8ef96baf 100644 --- a/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal-list.tsx +++ b/src/renderer/src/pages/shared-modals/user-friend-modal/user-friend-modal-list.tsx @@ -62,9 +62,9 @@ export const UserFriendModalList = ({ }; useEffect(() => { - listContainer.current?.addEventListener("scroll", handleScroll); - return () => - listContainer.current?.removeEventListener("scroll", handleScroll); + const container = listContainer.current; + container?.addEventListener("scroll", handleScroll); + return () => container?.removeEventListener("scroll", handleScroll); }, [isLoading]); const reloadList = () => { diff --git a/src/renderer/src/pages/user/user-content.tsx b/src/renderer/src/pages/user/user-content.tsx index 90defa8c..c334389e 100644 --- a/src/renderer/src/pages/user/user-content.tsx +++ b/src/renderer/src/pages/user/user-content.tsx @@ -125,7 +125,7 @@ export function UserContent({ } setCurrentGame(userProfile.currentGame); - }, [gameRunning, isMe]); + }, [gameRunning, isMe, userProfile.currentGame]); useEffect(() => { if (isMe) fetchFriendRequests(); diff --git a/src/renderer/src/pages/user/user-profile-settings-modal/user-block-list.tsx b/src/renderer/src/pages/user/user-profile-settings-modal/user-block-list.tsx index c062eabb..0790b725 100644 --- a/src/renderer/src/pages/user/user-profile-settings-modal/user-block-list.tsx +++ b/src/renderer/src/pages/user/user-profile-settings-modal/user-block-list.tsx @@ -51,9 +51,9 @@ export const UserEditProfileBlockList = () => { }; useEffect(() => { - listContainer.current?.addEventListener("scroll", handleScroll); - return () => - listContainer.current?.removeEventListener("scroll", handleScroll); + const container = listContainer.current; + container?.addEventListener("scroll", handleScroll); + return () => container?.removeEventListener("scroll", handleScroll); }, [isLoading]); const reloadList = () => {