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
|
// Initialiser les IDs des messages au premier chargement
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (conversations && !initializedRef.current) {
|
if (conversations && Array.isArray(conversations) && !initializedRef.current) {
|
||||||
conversations.forEach((conversation) => {
|
conversations.forEach((conversation) => {
|
||||||
if (conversation.lastMessage) {
|
if (conversation.lastMessage) {
|
||||||
lastMessageIdsRef.current.set(conversation.id, conversation.lastMessage.id);
|
lastMessageIdsRef.current.set(conversation.id, conversation.lastMessage.id);
|
||||||
@@ -106,7 +106,7 @@ export default function MessageNotifications() {
|
|||||||
|
|
||||||
// Détecter les nouveaux messages
|
// Détecter les nouveaux messages
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!conversations || !currentUser || !initializedRef.current) return;
|
if (!conversations || !Array.isArray(conversations) || !currentUser || !initializedRef.current) return;
|
||||||
|
|
||||||
conversations.forEach((conversation) => {
|
conversations.forEach((conversation) => {
|
||||||
if (!conversation.lastMessage) return;
|
if (!conversation.lastMessage) return;
|
||||||
|
|||||||
BIN
prisma/dev.db
BIN
prisma/dev.db
Binary file not shown.
Reference in New Issue
Block a user