Skip to content

Usenet streaming with a WebDAV server and a SABnzbd-compatible API

C#

fix: remove 'Delete mounted files' option when clearing a failed history item.

nzbdav-devdfbc41148a08
diff --git a/frontend/app/components/confirm-modal/confirm-modal.tsx b/frontend/app/components/confirm-modal/confirm-modal.tsx
index 9377cef5..6a147ead 100644
--- a/frontend/app/components/confirm-modal/confirm-modal.tsx
+++ b/frontend/app/components/confirm-modal/confirm-modal.tsx
@@ -1,4 +1,4 @@
-import { Button, Form, Modal } from "react-bootstrap";
+import { Alert, Button, Form, Modal } from "react-bootstrap";
import { WordWrap } from "../word-wrap/word-wrap";
import { useCallback, useState, type ReactNode } from "react";
@@ -7,6 +7,7 @@ export type ConfirmModalProps = {
title: string,
message: ReactNode,
checkboxMessage?: string,
+ errorMessage?: string,
cancelText?: string,
confirmText?: string,
onCancel: () => void,
@@ -45,6 +46,11 @@ export function ConfirmModal(props: ConfirmModalProps) {
checked={isCheckboxChecked}
onChange={(e) => setIsCheckboxChecked(Boolean(e.target.checked))} />
}
+ {props.errorMessage &&
+ <Alert variant="warning" style={{ marginTop: '20px', fontSize: '14px' }}>
+ {props.errorMessage}
+ </Alert>
+ }
</div>
</Modal.Body>
<Modal.Footer>
diff --git a/frontend/app/routes/queue/components/history-table/history-table.tsx b/frontend/app/routes/queue/components/history-table/history-table.tsx
index a8d7d94b..ee0a2af8 100644
--- a/frontend/app/routes/queue/components/history-table/history-table.tsx
+++ b/frontend/app/routes/queue/components/history-table/history-table.tsx
@@ -152,7 +152,8 @@ export function HistoryRow({ slot, onIsSelectedChanged, onIsRemovingChanged, onR
show={isConfirmingRemoval}
title="Remove From History?"
message={slot.nzb_name}
- checkboxMessage="Delete mounted files"
+ checkboxMessage={!slot.fail_message ? "Delete mounted files" : undefined}
+ errorMessage={slot.fail_message}
onConfirm={onConfirmRemoval}
onCancel={onCancelRemoval} />
</>