Skip to content

Open source CapCut alternative.

TypeScript

fix(site): editor stops waiting for an engine announcement that already fired

David Lec969cbfd3b28
diff --git a/site/src/cut/components/Editor.tsx b/site/src/cut/components/Editor.tsx
index b29e75c9..5fb6b6ed 100644
--- a/site/src/cut/components/Editor.tsx
+++ b/site/src/cut/components/Editor.tsx
@@ -151,8 +151,8 @@ export function Editor({
});
void bind.then((placement) => {
if (!alive) return;
- setNeedsApp(!placement.reachable);
if (placement.reachable) {
+ setNeedsApp(false);
// loadProject clears `loaded` synchronously before its first await,
// so marking the mount opened here can never show the editor
// against leftover state.
@@ -175,6 +175,17 @@ export function Editor({
waiting = undefined;
open();
});
+ // The gate's probe may have reached the engine while the placement
+ // above was resolving — its announcement fired before this
+ // subscription existed. Subscribing first and then reading the
+ // current answer closes that gap in both orders.
+ if (hasLocalCompute()) {
+ waiting();
+ waiting = undefined;
+ open();
+ return;
+ }
+ setNeedsApp(true);
});
};
open();