diff --git a/vibn-frontend/app/[workspace]/project/[projectId]/(home)/preview/page.tsx b/vibn-frontend/app/[workspace]/project/[projectId]/(home)/preview/page.tsx index a360d0d6..de0210de 100644 --- a/vibn-frontend/app/[workspace]/project/[projectId]/(home)/preview/page.tsx +++ b/vibn-frontend/app/[workspace]/project/[projectId]/(home)/preview/page.tsx @@ -115,6 +115,10 @@ export default function PreviewTab() { // ── Auto-ensure: fire a background restart when the pane loads and finds // no running dev server, but there's a previous config to restart from. const ensureCalledRef = useRef(false); + const deviceMode = usePreviewToolbarStore((s) => s.deviceMode); + const refreshKey = usePreviewToolbarStore((s) => s.refreshKey); + const currentPath = usePreviewToolbarStore((s) => s.currentPath); + const [ensureStatus, setEnsureStatus] = useState< "idle" | "calling" | "starting" | "no_history" | "error" >("idle"); @@ -159,10 +163,6 @@ export default function PreviewTab() { const bridge = usePreviewBridge(); const origin = typeof window !== "undefined" ? window.location.origin : ""; - const deviceMode = usePreviewToolbarStore((s) => s.deviceMode); - const refreshKey = usePreviewToolbarStore((s) => s.refreshKey); - const currentPath = usePreviewToolbarStore((s) => s.currentPath); - const [isForceStarting, setIsForceStarting] = useState(false); // When the user clicks the manual refresh button in the toolbar, we don't