fix: resolve queue management and metadata fetch bugs

- Reset isRemoving state in DeleteConfirmationModal on open and close to prevent UI freeze
- Filter sidebar queue count to exclude completed downloads
- Return fully resolved URL from backend metadata fetch to avoid 403s on one-time tokens
This commit is contained in:
NimBold
2026-06-21 14:57:21 +03:30
parent 3660ceb47a
commit d535bdac8f
5 changed files with 14 additions and 5 deletions
+9 -1
View File
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import { useDownloadStore } from '../store/useDownloadStore';
import { AlertTriangle } from 'lucide-react';
@@ -7,6 +7,13 @@ export const DeleteConfirmationModal: React.FC = () => {
const [errorMessage, setErrorMessage] = useState('');
const [isRemoving, setIsRemoving] = useState(false);
useEffect(() => {
if (deleteModalState.isOpen) {
setIsRemoving(false);
setErrorMessage('');
}
}, [deleteModalState.isOpen]);
if (!deleteModalState.isOpen) return null;
const handleCancel = () => {
@@ -38,6 +45,7 @@ export const DeleteConfirmationModal: React.FC = () => {
setIsRemoving(false);
return;
}
setIsRemoving(false);
closeDeleteModal();
};