Repository navigation
Commit 52df57a
committed
fix: defer loadingVersion clear and destroy pending preview on unmount
Bug 1: loadingVersion was cleared before writeVersion, so the URL
effect's re-entrant loadVersion call missed the already-loading
shortcut and took the same-version branch instead, which incremented
versionSeq and broke the original call's final status clear. Move
loadingVersion = null into the post-compileAndRun guard so the
shortcut stays active through the URL write.
Bug 2: If the playground unmounts while a preview is awaiting ready,
the in-flight nextPreview (not yet assigned to preview) was not
destroyed, leaking its window listener and MutationObserver until the
ready timeout. Track pendingPreview and destroy it in cleanup.1 parent cf38dcf commit 52df57a
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1246 | 1246 | | |
1247 | 1247 | | |
1248 | 1248 | | |
| 1249 | + | |
1249 | 1250 | | |
1250 | 1251 | | |
1251 | 1252 | | |
| |||
1291 | 1292 | | |
1292 | 1293 | | |
1293 | 1294 | | |
| 1295 | + | |
1294 | 1296 | | |
| 1297 | + | |
1295 | 1298 | | |
1296 | 1299 | | |
1297 | 1300 | | |
1298 | 1301 | | |
1299 | 1302 | | |
1300 | 1303 | | |
1301 | | - | |
1302 | 1304 | | |
1303 | 1305 | | |
1304 | 1306 | | |
| |||
1324 | 1326 | | |
1325 | 1327 | | |
1326 | 1328 | | |
1327 | | - | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1328 | 1333 | | |
1329 | 1334 | | |
1330 | 1335 | | |
| |||
1389 | 1394 | | |
1390 | 1395 | | |
1391 | 1396 | | |
| 1397 | + | |
1392 | 1398 | | |
1393 | 1399 | | |
1394 | 1400 | | |
| |||
0 commit comments