Техническое уведомление (#38) #40
@@ -63,8 +63,6 @@ export function MatchDetailPage() {
|
|||||||
const draftPayload = useRef<MatchFinishDraftData | null>(null);
|
const draftPayload = useRef<MatchFinishDraftData | null>(null);
|
||||||
const lastLocalEdit = useRef(0);
|
const lastLocalEdit = useRef(0);
|
||||||
const appliedDraftAt = useRef<string | null>(null);
|
const appliedDraftAt = useRef<string | null>(null);
|
||||||
const iFinished = useRef(false);
|
|
||||||
const prevStatus = useRef<string | null>(null);
|
|
||||||
|
|
||||||
const sendDraft = () => {
|
const sendDraft = () => {
|
||||||
draftTimer.current = null;
|
draftTimer.current = null;
|
||||||
@@ -101,15 +99,6 @@ export function MatchDetailPage() {
|
|||||||
appliedDraftAt.current = incoming.updated_at;
|
appliedDraftAt.current = incoming.updated_at;
|
||||||
}, [incoming, match?.status, me?.id]);
|
}, [incoming, match?.status, me?.id]);
|
||||||
|
|
||||||
// Партию завершил кто-то другой — форма исчезает, и без этого молча.
|
|
||||||
useEffect(() => {
|
|
||||||
if (!match) return;
|
|
||||||
if (prevStatus.current === "in_progress" && match.status === "finished" && !iFinished.current) {
|
|
||||||
toast.show("Партию завершил другой участник — показаны его результаты");
|
|
||||||
}
|
|
||||||
prevStatus.current = match.status;
|
|
||||||
}, [match, toast]);
|
|
||||||
|
|
||||||
if (isLoading) return <Spinner />;
|
if (isLoading) return <Spinner />;
|
||||||
if (!match) return <div className="muted">Партия не найдена.</div>;
|
if (!match) return <div className="muted">Партия не найдена.</div>;
|
||||||
|
|
||||||
@@ -146,7 +135,6 @@ export function MatchDetailPage() {
|
|||||||
clearTimeout(draftTimer.current);
|
clearTimeout(draftTimer.current);
|
||||||
sendDraft();
|
sendDraft();
|
||||||
}
|
}
|
||||||
iFinished.current = true;
|
|
||||||
const commentOf = (uid: number) => (finishComments[uid] ?? "").trim() || null;
|
const commentOf = (uid: number) => (finishComments[uid] ?? "").trim() || null;
|
||||||
let place = 1;
|
let place = 1;
|
||||||
const survivors = finishBlocks.flatMap((ids) => {
|
const survivors = finishBlocks.flatMap((ids) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user