This commit is contained in:
Timothy Jaeryang Baek
2026-04-01 07:35:38 -05:00
parent 4764dd5d37
commit 124b7e9154
+3 -3
View File
@@ -2647,7 +2647,7 @@
const MAX_DRAFT_LENGTH = 5000; const MAX_DRAFT_LENGTH = 5000;
let saveDraftTimeout: ReturnType<typeof setTimeout> | null = null; let saveDraftTimeout: ReturnType<typeof setTimeout> | null = null;
const saveDraft = async (draft, chatId = null) => { const saveDraft = async (draft: any, chatId: string | null = null) => {
if (saveDraftTimeout) { if (saveDraftTimeout) {
clearTimeout(saveDraftTimeout); clearTimeout(saveDraftTimeout);
} }
@@ -2664,7 +2664,7 @@
} }
}; };
const clearDraft = async (chatId = null) => { const clearDraft = async (chatId: string | null = null) => {
if (saveDraftTimeout) { if (saveDraftTimeout) {
clearTimeout(saveDraftTimeout); clearTimeout(saveDraftTimeout);
} }
@@ -2937,7 +2937,7 @@
} }
}} }}
on:submit={async (e) => { on:submit={async (e) => {
clearDraft(); clearDraft($chatId);
if (e.detail || files.length > 0) { if (e.detail || files.length > 0) {
await tick(); await tick();