Commit 3d11d59
committed
fix(drafts): guard save effect against first-render race that wipes file-only drafts
On mount the save effect fired before the restore effect's setState calls
propagated, so fileAttachments and contexts were still empty. For a draft
with files but no text this caused isEmpty() to return true and setDraft to
delete the entry. Added isFirstSaveRef to skip the initial run; the restore
triggers a re-render that fires the save with the full, correct payload.1 parent c6f0195 commit 3d11d59
1 file changed
Lines changed: 7 additions & 0 deletions
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
208 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
| |||
0 commit comments