Files
Netcatty/components/ai/draftSendGate.ts
T
Cursor Agentand陈大猫 364e2ff686 fix: clear remaining StrictMode doubles and notes editor jank
Gate every AI send and reject concurrent runTurn, latch tray connect flush
and settings persistMounted remounts, and stop notes content drafts from
rebuilding MDXEditor/shell on each keystroke.

Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com>
2026-08-07 14:38:00 +00:00

17 lines
424 B
TypeScript

export function tryBeginDraftSend(gate: { current: boolean }): boolean {
if (gate.current) {
return false;
}
gate.current = true;
return true;
}
export function endDraftSend(gate: { current: boolean }): void {
gate.current = false;
}
/** Alias kept for call sites that gate every send (draft + session), not just draft. */
export const tryBeginSend = tryBeginDraftSend;
export const endSend = endDraftSend;