diff --git a/webui/src/components/OperationTree.tsx b/webui/src/components/OperationTree.tsx
index b037ccc3..16e05747 100644
--- a/webui/src/components/OperationTree.tsx
+++ b/webui/src/components/OperationTree.tsx
@@ -463,34 +463,39 @@ const BackupView = ({ backup }: { backup?: FlowDisplayInfo }) => {
}
};
- const deleteButton = backup.snapshotID ? (
-
+ const snapshotInFlow = backup?.operations.find(
+ (op) => op.op.case === "operationIndexSnapshot",
+ );
+
+ const deleteButton =
+ snapshotInFlow && snapshotInFlow.snapshotId ? (
+
+
+ Forget (Destructive)
+
+
+ ) : (
{
+ backrestService.clearHistory(
+ new ClearHistoryRequest({
+ selector: new OpSelector({
+ ids: backup.operations.map((op) => op.id),
+ }),
+ }),
+ );
+ }}
>
- Forget (Destructive)
+ Delete Event
-
- ) : (
- {
- backrestService.clearHistory(
- new ClearHistoryRequest({
- selector: new OpSelector({
- ids: backup.operations.map((op) => op.id),
- }),
- }),
- );
- }}
- >
- Delete Event
-
- );
+ );
return (