(project)
| 369 | }, |
| 370 | |
| 371 | async initProject(project) { |
| 372 | // Dedupe concurrent inits for the same project. During bootstrap |
| 373 | // the editor-state subscriber fires a fire-and-forget initProject |
| 374 | // while SQLEditorRouteShell separately awaits initProject and then |
| 375 | // opens the URL route tab. Sharing one in-flight hydration prevents |
| 376 | // the unawaited copy from resolving afterwards and replacing |
| 377 | // `tabsById` — which would drop the just-opened route tab. |
| 378 | if (_initProjectInFlight?.project === project) { |
| 379 | return _initProjectInFlight.promise; |
| 380 | } |
| 381 | const promise = hydrateProjectTabs(project); |
| 382 | _initProjectInFlight = { project, promise }; |
| 383 | try { |
| 384 | await promise; |
| 385 | } finally { |
| 386 | if (_initProjectInFlight?.project === project) { |
| 387 | _initProjectInFlight = undefined; |
| 388 | } |
| 389 | } |
| 390 | }, |
| 391 | |
| 392 | reset() { |
| 393 | set((s) => { |
nothing calls this directly
no test coverage detected