From d509e9e1a6bdcabab7a95166f373e7696e7b40f3 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Wed, 6 Dec 2023 11:32:57 +0200 Subject: [PATCH] Make SendouQ match non-revalidating again Closes #1593 --- app/features/chat/components/Chat.tsx | 4 +++- app/features/sendouq/routes/q.match.$id.tsx | 8 +++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/features/chat/components/Chat.tsx b/app/features/chat/components/Chat.tsx index b61312784..65b79913e 100644 --- a/app/features/chat/components/Chat.tsx +++ b/app/features/chat/components/Chat.tsx @@ -51,7 +51,9 @@ export function Chat({ onUnmount, disabled, missingUserName, -}: ChatProps & { chat: ReturnType }) { +}: Omit & { + chat: ReturnType; +}) { const { t } = useTranslation(["common"]); const messagesContainerRef = React.useRef(null); const inputRef = React.useRef(null); diff --git a/app/features/sendouq/routes/q.match.$id.tsx b/app/features/sendouq/routes/q.match.$id.tsx index 655468c3e..69b1c030b 100644 --- a/app/features/sendouq/routes/q.match.$id.tsx +++ b/app/features/sendouq/routes/q.match.$id.tsx @@ -1026,7 +1026,9 @@ function BottomSection({ ].filter(Boolean) as ChatProps["rooms"]; }, [data.matchChatCode, data.groupChatCode]); - const chat = useChat({ rooms: chatRooms, onNewMessage }); + // revalidates: false because we don't want the user to lose the weapons + // they are reporting when the match gets suddenly locked + const chat = useChat({ rooms: chatRooms, onNewMessage, revalidates: false }); const onChatMount = React.useCallback(() => { setChatVisible(true); @@ -1053,16 +1055,12 @@ function BottomSection({ const chatElement = ( );