Fixed bugs API Conversations
This commit is contained in:
@@ -94,7 +94,7 @@ export default function MessageNotifications() {
|
||||
|
||||
// Initialiser les IDs des messages au premier chargement
|
||||
useEffect(() => {
|
||||
if (conversations && !initializedRef.current) {
|
||||
if (conversations && Array.isArray(conversations) && !initializedRef.current) {
|
||||
conversations.forEach((conversation) => {
|
||||
if (conversation.lastMessage) {
|
||||
lastMessageIdsRef.current.set(conversation.id, conversation.lastMessage.id);
|
||||
@@ -106,7 +106,7 @@ export default function MessageNotifications() {
|
||||
|
||||
// Détecter les nouveaux messages
|
||||
useEffect(() => {
|
||||
if (!conversations || !currentUser || !initializedRef.current) return;
|
||||
if (!conversations || !Array.isArray(conversations) || !currentUser || !initializedRef.current) return;
|
||||
|
||||
conversations.forEach((conversation) => {
|
||||
if (!conversation.lastMessage) return;
|
||||
|
||||
Reference in New Issue
Block a user