mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-12 06:06:28 -05:00
Make SendouQ match non-revalidating again Closes #1593
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user