MCPcopy Index your code
hub / github.com/xintaofei/codeg / saveMessageInputDraft

Function saveMessageInputDraft

src/lib/message-input-draft.ts:155–167  ·  view source on GitHub ↗
(draftKey: string, text: string)

Source from the content-addressed store, hash-verified

153}
154
155export 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
169export function clearMessageInputDraft(draftKey: string): void {
170 draftTextCache.delete(draftKey)

Calls 2

clearMessageInputDraftFunction · 0.85
scheduleDraftPersistenceFunction · 0.85

Tested by

no test coverage detected