fix js delete torrent bug
This commit is contained in:
parent
f789be22c9
commit
73e41ba7d5
1 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ const DeleteTorrentModal = ({ id, show, onHide }) => {
|
||||||
const [error, setError] = useState<Error>(null);
|
const [error, setError] = useState<Error>(null);
|
||||||
const [deleting, setDeleting] = useState(false);
|
const [deleting, setDeleting] = useState(false);
|
||||||
|
|
||||||
const refreshCtx = useContext(RefreshTorrentStatsContext);
|
const ctx = useContext(AppContext);
|
||||||
|
|
||||||
const close = () => {
|
const close = () => {
|
||||||
setDeleteFiles(false);
|
setDeleteFiles(false);
|
||||||
|
|
@ -55,7 +55,7 @@ const DeleteTorrentModal = ({ id, show, onHide }) => {
|
||||||
const call = deleteFiles ? API.delete : API.forget;
|
const call = deleteFiles ? API.delete : API.forget;
|
||||||
|
|
||||||
call(id).then(() => {
|
call(id).then(() => {
|
||||||
refreshCtx.refresh();
|
ctx.refreshTorrents();
|
||||||
close();
|
close();
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
setError({
|
setError({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue