diff --git a/apps/desktop/src/context/ConversationsContext.tsx b/apps/desktop/src/context/ConversationsContext.tsx index 02b68b2..7b070e0 100644 --- a/apps/desktop/src/context/ConversationsContext.tsx +++ b/apps/desktop/src/context/ConversationsContext.tsx @@ -151,6 +151,15 @@ export function ConversationsProvider({ children }: { children: ReactNode }) { .on('postgres_changes', { event: '*', schema: 'public', table: 'conversations' }, () => { void refresh(); }) + .on( + 'postgres_changes', + { event: 'UPDATE', schema: 'public', table: 'profiles' }, + () => { + // Peer updated their profile (e.g. uploaded avatar / changed name). + // Re-pull conversations so members[].profile picks up the new data. + void refresh(); + }, + ) .on( 'postgres_changes', { event: 'INSERT', schema: 'public', table: 'messages' }, diff --git a/apps/desktop/src/pages/ConversationPage.tsx b/apps/desktop/src/pages/ConversationPage.tsx index 0a51cac..bc3a9bd 100644 --- a/apps/desktop/src/pages/ConversationPage.tsx +++ b/apps/desktop/src/pages/ConversationPage.tsx @@ -1,3 +1,4 @@ +import { parseMessagePayload } from '@chat-app/shared/chat'; import { extractErrorCode } from '@chat-app/shared/i18n'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -204,12 +205,26 @@ export function ConversationPage() { ) : (