mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-17 21:10:48 +00:00
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>
17 lines
424 B
TypeScript
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;
|