mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-09 10:49:29 +00:00
feat(ui): implement multi-select and fix finder reveal
- Fix 'Show in finder' for unfinished entries to open destination folder - Add 'Add to queue' submenu for unfinished items - Support Shift/Cmd modifiers for multi-selection in download list - Implement mass-action context menu for multi-selected downloads - Enhance DeleteConfirmationModal to handle mass deletions gracefully
This commit is contained in:
@@ -14,10 +14,10 @@ export const DeleteConfirmationModal: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleRemoveFromList = async () => {
|
||||
if (deleteModalState.downloadId) {
|
||||
if (deleteModalState.downloadIds && deleteModalState.downloadIds.length > 0) {
|
||||
setIsRemoving(true);
|
||||
try {
|
||||
await removeDownload(deleteModalState.downloadId, false);
|
||||
await Promise.all(deleteModalState.downloadIds.map(id => removeDownload(id, false)));
|
||||
} catch (error) {
|
||||
setErrorMessage(`Remove failed: ${String(error)}`);
|
||||
setIsRemoving(false);
|
||||
@@ -28,10 +28,10 @@ export const DeleteConfirmationModal: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleDeleteFile = async () => {
|
||||
if (deleteModalState.downloadId) {
|
||||
if (deleteModalState.downloadIds && deleteModalState.downloadIds.length > 0) {
|
||||
setIsRemoving(true);
|
||||
try {
|
||||
await removeDownload(deleteModalState.downloadId, true);
|
||||
await Promise.all(deleteModalState.downloadIds.map(id => removeDownload(id, true)));
|
||||
} catch (error) {
|
||||
setErrorMessage(`Delete failed: ${String(error)}`);
|
||||
setIsRemoving(false);
|
||||
@@ -55,7 +55,7 @@ export const DeleteConfirmationModal: React.FC = () => {
|
||||
</div>
|
||||
|
||||
<div className="px-5 py-6 flex-1 text-sm text-text-secondary leading-relaxed">
|
||||
Are you sure you want to remove this item from the list? You can also choose to delete the underlying file from your hard drive.
|
||||
{`Are you sure you want to remove ${deleteModalState.downloadIds?.length && deleteModalState.downloadIds.length > 1 ? 'these ' + deleteModalState.downloadIds.length + ' items' : 'this item'} from the list? You can also choose to delete the underlying file from your hard drive.`}
|
||||
{errorMessage && <div className="mt-3 text-xs text-red-400">{errorMessage}</div>}
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user