Make SendouQ match non-revalidating again Closes #1593

This commit is contained in:
Kalle
2023-12-06 11:32:57 +02:00
parent 39d76a065f
commit d509e9e1a6
2 changed files with 6 additions and 6 deletions

View File

@@ -51,7 +51,9 @@ export function Chat({
onUnmount,
disabled,
missingUserName,
}: ChatProps & { chat: ReturnType<typeof useChat> }) {
}: Omit<ChatProps, "revalidates" | "onNewMessage"> & {
chat: ReturnType<typeof useChat>;
}) {
const { t } = useTranslation(["common"]);
const messagesContainerRef = React.useRef<HTMLOListElement>(null);
const inputRef = React.useRef<HTMLInputElement>(null);

View File

@@ -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 = (
<Chat
onNewMessage={onNewMessage}
chat={chat}
onMount={onChatMount}
onUnmount={onChatUnmount}
users={chatUsers}
rooms={chatRooms}
disabled={!data.canPostChatMessages}
// we don't want the user to lose the weapons they are reporting
// when the match gets suddenly locked
revalidates={false}
/>
);