bf4d8ef41f0d
fix note not saving on back — await save() before onBack() to prevent premature unmount (v2.40.0)
- time
- 2026-05-13 16:27 UTC · 5 months ago
- machine
- koh2
- parent
- 062893bfec58
↓ peach-browser-bf4d8ef4.tar.gzatlas at this save
files changed4 files
manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −1src/popup/views/NotesEditor.tsx+4 −5manifest.firefox.json+1 −1
@@ -1,7 +1,7 @@11 {22 "manifest_version": 3,33 "name": "Peach",4- "version": "2.39.9",4+ "version": "2.40.0",55 "description": "Zero-knowledge password manager",66 "browser_specific_settings": {77 "gecko": {manifest.json+1 −1
@@ -1,7 +1,7 @@11 {22 "manifest_version": 3,33 "name": "Peach",4- "version": "2.39.9",4+ "version": "2.40.0",55 "description": "Zero-knowledge password manager",66 "action": {77 "default_popup": "src/popup/index.html",package.json+1 −1
@@ -1,6 +1,6 @@11 {22 "name": "peach",3- "version": "2.39.9",3+ "version": "2.40.0",44 "description": "Zero-knowledge password manager",55 "type": "module",66 "scripts": {src/popup/views/NotesEditor.tsx+4 −5
@@ -68,13 +68,12 @@6868 scheduleAutosave();6969 }7070 71- function handleBack() {72- // Final save before going back (only if there's content and it's dirty)71+ async function handleBack() {72+ // Await the final save before navigating away — fire-and-forget would let73+ // the component unmount before the message round-trip completes.7374 if (dirty() && (title().trim() || body().trim())) {7475 if (saveTimer) { clearTimeout(saveTimer); saveTimer = null; }75- void save();76- } else if (!noteId() && !title().trim() && !body().trim()) {77- // Empty new note — discard76+ await save();7877 }7978 props.onBack();8079 }