diff --git a/ui/src/app/dashboard/sandboxes/page.tsx b/ui/src/app/dashboard/sandboxes/page.tsx index 35d6c4ce6f..95394afa72 100644 --- a/ui/src/app/dashboard/sandboxes/page.tsx +++ b/ui/src/app/dashboard/sandboxes/page.tsx @@ -606,6 +606,8 @@ function SandboxesPage() { const [editingLifecycleSandbox, setEditingLifecycleSandbox] = useState(null); const [editingNetworkSandbox, setEditingNetworkSandbox] = useState(null); const [manualRefreshing, setManualRefreshing] = useState(false); + const [creating, setCreating] = useState(false); + const creatingRef = useRef(false); const [refreshCooldown, setRefreshCooldown] = useState(false); const [nowMs, setNowMs] = useState(() => Date.now()); const refreshCooldownRef = useRef(false); @@ -750,9 +752,11 @@ function SandboxesPage() { org_id?: string; template: string; runtime: string; - boot_mode?: string; snapshots?: boolean; }) => { + if (creatingRef.current) return; + creatingRef.current = true; + setCreating(true); try { const payload = { name: values.name || null, @@ -821,6 +825,9 @@ function SandboxesPage() { }); } catch (err: any) { message.error(err.message); + } finally { + creatingRef.current = false; + setCreating(false); } }; @@ -1210,13 +1217,6 @@ function SandboxesPage() { ))} - - - Snapshots @@ -1229,7 +1229,7 @@ function SandboxesPage() { Clear ) : null} - +