githubnext/ace2Public

Ace: a collaborative coding environment on the team's own machines

fix(ui): keep unsent composer drafts across restart

Store composer drafts in localStorage under the existing ace:draft scope keys and write each edit synchronously, so a browser or app restart, including a quit right after typing, keeps the draft. Live sessionStorage drafts migrate unless a durable draft already exists; the legacy copy is removed once a durable one exists. Storage failures never break editor input.

Refs #77
IAiamnbutler authored
cf89a0fPatch
Parent6dc0f1c
1 file changed+52-32
StackedSplit
packages/ui/src/hooks/use-draft.ts+52 −32