generated from nhcarrigan/template
fix: clear draft store when message is submitted
This commit is contained in:
@@ -175,6 +175,14 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function clearInput() {
|
||||||
|
inputValue = "";
|
||||||
|
const activeId = get(claudeStore.activeConversationId);
|
||||||
|
if (activeId) {
|
||||||
|
claudeStore.setDraftText(activeId, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleInputChange() {
|
function handleInputChange() {
|
||||||
// If input is empty, allow history navigation again
|
// If input is empty, allow history navigation again
|
||||||
// Otherwise, mark that user has manually typed
|
// Otherwise, mark that user has manually typed
|
||||||
@@ -212,7 +220,7 @@
|
|||||||
async function executeSlashCommand(): Promise<boolean> {
|
async function executeSlashCommand(): Promise<boolean> {
|
||||||
const { command, args } = parseSlashCommand(inputValue);
|
const { command, args } = parseSlashCommand(inputValue);
|
||||||
if (command) {
|
if (command) {
|
||||||
inputValue = "";
|
clearInput();
|
||||||
showCommandMenu = false;
|
showCommandMenu = false;
|
||||||
matchingCommands = [];
|
matchingCommands = [];
|
||||||
await command.execute(args);
|
await command.execute(args);
|
||||||
@@ -245,7 +253,7 @@
|
|||||||
"error",
|
"error",
|
||||||
`Unknown command: ${message.split(" ")[0]}. Type /help for available commands.`
|
`Unknown command: ${message.split(" ")[0]}. Type /help for available commands.`
|
||||||
);
|
);
|
||||||
inputValue = "";
|
clearInput();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,7 +269,7 @@
|
|||||||
userHasTyped = false;
|
userHasTyped = false;
|
||||||
|
|
||||||
isSubmitting = true;
|
isSubmitting = true;
|
||||||
inputValue = "";
|
clearInput();
|
||||||
|
|
||||||
// Capture attachments before clearing
|
// Capture attachments before clearing
|
||||||
const currentAttachments = [...attachments];
|
const currentAttachments = [...attachments];
|
||||||
|
|||||||
Reference in New Issue
Block a user