(draftKey: string, text: string)
| 153 | } |
| 154 | |
| 155 | export function saveMessageInputDraft(draftKey: string, text: string): void { |
| 156 | if (text.length === 0) { |
| 157 | clearMessageInputDraft(draftKey) |
| 158 | return |
| 159 | } |
| 160 | |
| 161 | if (draftTextCache.get(draftKey) === text) return |
| 162 | draftTextCache.set(draftKey, text) |
| 163 | if (typeof window === "undefined") return |
| 164 | |
| 165 | pendingPersistDrafts.set(draftKey, text) |
| 166 | scheduleDraftPersistence() |
| 167 | } |
| 168 | |
| 169 | export function clearMessageInputDraft(draftKey: string): void { |
| 170 | draftTextCache.delete(draftKey) |
no test coverage detected