MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / clearDraft

Function clearDraft

apps/kimi-web/src/composables/useComposerDraft.ts:82–84  ·  view source on GitHub ↗

* Synchronously clear the persisted draft for the current session. * Call this right after clearing `text.value` on send/steer; relying on the * text watcher is unsafe because the Composer may unmount before the watcher * flushes (e.g. when the optimistic user message replaces the empty-ses

()

Source from the content-addressed store, hash-verified

80 * composer), causing the next mount to reload the stale draft.
81 */
82 function clearDraft(): void {
83 saveDraft(sessionId(), '');
84 }
85
86 return { text, textareaRef, autosize, loadForEdit, clearDraft };
87}

Callers 1

selectFunction · 0.85

Calls 1

saveDraftFunction · 0.85

Tested by

no test coverage detected