fix: block message submission whilst Claude is processing

Prevents the race condition where sending a message before the previous
turn's result message arrives caused both to be processed together,
making it appear the first message was ignored.
This commit is contained in:
2026-03-09 13:05:26 -07:00
committed by Naomi Carrigan
parent ff0ba7b6d0
commit dd79ed5ab9
+3 -3
View File
@@ -248,7 +248,7 @@
const hasAttachments = attachments.length > 0; const hasAttachments = attachments.length > 0;
// Need either a message or attachments to submit // Need either a message or attachments to submit
if ((!message && !hasAttachments) || isSubmitting) return; if ((!message && !hasAttachments) || isSubmitting || isProcessing) return;
// Check for slash commands first (these work even when disconnected) // Check for slash commands first (these work even when disconnected)
if (message && isSlashCommand(message)) { if (message && isSlashCommand(message)) {
@@ -768,7 +768,7 @@ User: ${formattedMessage}`;
async function handleQuickAction(prompt: string): Promise<void> { async function handleQuickAction(prompt: string): Promise<void> {
// Quick actions send the prompt directly // Quick actions send the prompt directly
if (!isConnected || isSubmitting) return; if (!isConnected || isSubmitting || isProcessing) return;
// Add to history // Add to history
addToHistory(prompt); addToHistory(prompt);
@@ -1018,7 +1018,7 @@ User: ${formattedMessage}`;
placeholder={isConnected placeholder={isConnected
? "Ask Hikari anything... (type / for commands)" ? "Ask Hikari anything... (type / for commands)"
: "Connect to Claude first..."} : "Connect to Claude first..."}
disabled={isSubmitting} disabled={isSubmitting || isProcessing}
rows={1} rows={1}
style="height: {textareaHeight}px; font-size: var(--terminal-font-size, 14px); font-family: var(--terminal-font-family, monospace);" style="height: {textareaHeight}px; font-size: var(--terminal-font-size, 14px); font-family: var(--terminal-font-family, monospace);"
class="w-full px-4 py-3 bg-[var(--bg-secondary)] border border-[var(--border-color)] class="w-full px-4 py-3 bg-[var(--bg-secondary)] border border-[var(--border-color)]