proper clear draft message

This commit is contained in:
Eva Ho
2025-12-12 16:56:44 -05:00
parent ed553f51f7
commit 42d6a3f075
6 changed files with 29 additions and 2 deletions

View File

@@ -707,6 +707,14 @@ func (db *database) updateChatDraft(chatID string, draft string) error {
return nil
}
func (db *database) clearAllDrafts() error {
_, err := db.conn.Exec(`UPDATE chats SET draft = ''`)
if err != nil {
return fmt.Errorf("clear all drafts: %w", err)
}
return nil
}
// updateChatBrowserState updates only the browser_state for a chat
func (db *database) updateChatBrowserState(chatID string, state json.RawMessage) error {
_, err := db.conn.Exec(`UPDATE chats SET browser_state = ? WHERE id = ?`, string(state), chatID)