From fa9ac427bd3f426a446fe27d62054c86e776a559 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:20:56 +0300 Subject: [PATCH] Don't modify chat messages array in place --- app/features/chat/ChatProvider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/features/chat/ChatProvider.tsx b/app/features/chat/ChatProvider.tsx index 9876bbfce..965f423bf 100644 --- a/app/features/chat/ChatProvider.tsx +++ b/app/features/chat/ChatProvider.tsx @@ -402,7 +402,7 @@ function ChatProviderInner({ const messagesForRoom = React.useCallback( (chatCode: string) => { - return (messagesByRoom[chatCode] ?? []).sort( + return (messagesByRoom[chatCode] ?? []).toSorted( (a, b) => a.timestamp - b.timestamp, ); },