mirror of
https://github.com/filecoin-project/slate.git
synced 2024-09-11 22:07:08 +03:00
feat(UploadSummary): sort by status and date
This commit is contained in:
parent
35e9887257
commit
efdf7938b0
@ -285,7 +285,16 @@ function Summary({ onAction }) {
|
||||
|
||||
const uploadSummary = React.useMemo(() => {
|
||||
const uploadSummary = Object.entries(fileLoading).map(([, file]) => file);
|
||||
return uploadSummary.sort((a, b) => b.createdAt - a.createdAt);
|
||||
|
||||
const statusOrder = {
|
||||
failed: 1,
|
||||
saving: 2,
|
||||
duplicate: 3,
|
||||
success: 4,
|
||||
};
|
||||
return uploadSummary.sort(
|
||||
(a, b) => statusOrder[a.status] - statusOrder[b.status] || a.createdAt - b.createdAt
|
||||
);
|
||||
}, [fileLoading]);
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user