githubnext/ace2Public

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

fix(ui): keep unsent composer drafts across restart (#165)

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
NBNate Butler authored committed by GitHub
5194bf7Patch
Parent824d497
1 file changed+52-32
StackedSplit
packages/ui/src/hooks/use-draft.ts+52 −32