Skip to content

The open-source full-stack studio for Opus 5.5 motion video. Reverse engineering for any video. Code video with HTML: recreate, edit and render. BYOA + BYOK · Motion.md · Images, Video, Music & Voice.

fix(deploy-control): stabilize empty deployments selector (#33)

Wei Zhou6740f279c0c7
diff --git a/src/components/deploy-control.tsx b/src/components/deploy-control.tsx
index 66007afd..2b0832a0 100644
--- a/src/components/deploy-control.tsx
+++ b/src/components/deploy-control.tsx
@@ -9,6 +9,8 @@ import {
type DeploymentRecord,
} from "@/lib/store";
+const EMPTY_DEPLOYMENTS: readonly DeploymentRecord[] = [];
+
/**
* Publish-to-Vercel control rendered next to the preview-pane toolbar
* actions. Renders three things in one rounded popover-anchor block:
@@ -31,7 +33,7 @@ export function DeployControl() {
const html = useStore((s) => selectActiveTask(s)?.html ?? "");
const taskId = useStore((s) => s.activeTaskId);
const deployments = useStore(
- (s) => selectActiveTask(s)?.deployments ?? [],
+ (s) => selectActiveTask(s)?.deployments ?? EMPTY_DEPLOYMENTS,
);
const removeDeploymentFor = useStore((s) => s.removeDeploymentFor);
const t = useT();