Commit 90ef888
Fix Cmd+N creating duplicate notes in dev mode
The Tauri event listeners were registered via async Promise.all, but
cleanup ran before promises resolved (unlisten vars still null). In
React StrictMode this left two active listeners per event, causing
double note creation. Use a cancelled flag so late-resolving disposers
clean up immediately.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 2fb4c97 commit 90ef888
1 file changed
Lines changed: 11 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 218 | + | |
| 219 | + | |
223 | 220 | | |
224 | 221 | | |
225 | 222 | | |
226 | 223 | | |
227 | 224 | | |
228 | 225 | | |
229 | 226 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
245 | 234 | | |
246 | 235 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 236 | + | |
| 237 | + | |
252 | 238 | | |
253 | 239 | | |
254 | 240 | | |
| |||
0 commit comments