Skip to content

Commit

Permalink
Fix for ConfirmRemove dialog not closing after removing a download (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
egbertbouman authored Feb 19, 2025
2 parents 4b9a6db + befe2cc commit f6ac7cc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/tribler/ui/src/dialogs/ConfirmRemove.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { Download } from "@/models/download.model";
import { TFunction } from "i18next";


interface MoveStorageProps {
interface ConfirmRemoveProps {
selectedDownloads: Download[];
onRemove: (selectedDownloads: Download[], removeData: boolean, t: TFunction) => void;
}

export default function ConfirmRemove(props: JSX.IntrinsicAttributes & DialogProps & MoveStorageProps) {
export default function ConfirmRemove(props: JSX.IntrinsicAttributes & DialogProps & ConfirmRemoveProps) {
const { t } = useTranslation();

return (
Expand All @@ -28,13 +28,19 @@ export default function ConfirmRemove(props: JSX.IntrinsicAttributes & DialogPro
<Button
variant="outline"
type="submit"
onClick={() => { props.onRemove(props.selectedDownloads, false, t) }}>
onClick={() => {
props.onRemove(props.selectedDownloads, false, t);
props.onOpenChange?.(false);
}}>
{t('RemoveDownload')}
</Button>
<Button
variant="outline"
type="submit"
onClick={() => { props.onRemove(props.selectedDownloads, true, t) }}>
onClick={() => {
props.onRemove(props.selectedDownloads, true, t);
props.onOpenChange?.(false);
}}>
{t('RemoveDownloadData')}
</Button>
<DialogClose asChild>
Expand Down

0 comments on commit f6ac7cc

Please sign in to comment.