mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
Merge da8f941c03 into b993b4283e
This commit is contained in:
commit
3503abdb6b
|
|
@ -83,6 +83,16 @@ class DownloadComponent extends Component {
|
|||
continue: true,
|
||||
};
|
||||
|
||||
deleteFinished = (index) => {
|
||||
return () => {
|
||||
this.setState({
|
||||
finishedList: this.state.finishedList.filter((_, itemIndex) => {
|
||||
return index !== itemIndex;
|
||||
})
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
componentDidMount = () => {
|
||||
this.loadDownloading();
|
||||
};
|
||||
|
|
@ -203,7 +213,11 @@ class DownloadComponent extends Component {
|
|||
)}
|
||||
{this.state.finishedList.map((value, k) => {
|
||||
if (value.files) {
|
||||
return <FinishedCard key={k} task={value} />;
|
||||
return <FinishedCard
|
||||
key={k}
|
||||
task={value}
|
||||
deleteSelf={this.deleteFinished(k)}
|
||||
/>;
|
||||
}
|
||||
return null;
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ export default function FinishedCard(props) {
|
|||
ToggleSnackbar("top", "right", error.message, "error");
|
||||
})
|
||||
.then(() => {
|
||||
window.location.reload();
|
||||
props.deleteSelf();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue