Skip to content

Commit

Permalink
[FIX] Starred & Pinned messages sidebars fetch APIs infinitely (Rocke…
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreytheCoder authored Mar 23, 2024
1 parent fdf0bf8 commit 7cfcba9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const PinnedMessages = () => {
setLoading(false);
};
getPinnedMessages();
});
}, [RCInstance, setMessageList, setLoading]);

const isMessageNewDay = (current, previous) =>
!previous || !isSameDay(new Date(current.ts), new Date(previous.ts));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ const StarredMessages = () => {
(state) => state.setShowStarred
);

const [messageList, setmessageList] = useState([]);
const [messageList, setMessageList] = useState([]);
const [loading, setLoading] = useState(true);

useEffect(() => {
const getStarredMessages = async () => {
const { messages } = await RCInstance.getStarredMessages();
setmessageList(messages);
setMessageList(messages);
setLoading(false);
};
getStarredMessages();
});
}, [RCInstance, setMessageList, setLoading]);

const isMessageNewDay = (current, previous) =>
!previous || !isSameDay(new Date(current.ts), new Date(previous.ts));
Expand Down

0 comments on commit 7cfcba9

Please sign in to comment.