fix(deploy): toast when restoring checkpoint with no snapshot

handleRestore previously returned silently when deployedConfigSnapshot
was null, leaving the user wondering why their click did nothing. Show
a warning toast explaining that the checkpoint predates snapshotting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-23 00:34:45 +02:00
parent 4d4c59efe3
commit 703bd412ed

View File

@@ -321,7 +321,14 @@ export default function AppDeploymentPage() {
const deployment = deployments.find((d) => d.id === deploymentId);
if (!deployment) return;
const snap = deployment.deployedConfigSnapshot;
if (!snap) return;
if (!snap) {
toast({
title: 'Cannot restore checkpoint',
description: 'This checkpoint predates snapshotting and cannot be restored.',
variant: 'warning',
});
return;
}
setForm((prev) => {
const a = snap.agentConfig ?? {};