Skip to content

Commit

Permalink
Check if messagesStatus undefined in ChatScreen (#3113)
Browse files Browse the repository at this point in the history
  • Loading branch information
dharit-tan committed Mar 28, 2023
1 parent 3dd481e commit c7f0540
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export const ChatScreen = () => {
const chatFrozenRef = useRef(chat)

useEffect(() => {
if (chatId && chat?.messagesStatus === Status.IDLE) {
if (chatId && (chat?.messagesStatus ?? Status.IDLE) === Status.IDLE) {
// Initial fetch
dispatch(fetchMoreMessages({ chatId }))
}
Expand Down

0 comments on commit c7f0540

Please sign in to comment.