mirror of
https://github.com/immich-app/immich.git
synced 2026-03-26 20:00:44 +03:00
committed by
GitHub
parent
2dd785e3e2
commit
b98a227bbd
@@ -80,7 +80,34 @@ function createUploadStore() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const removeItem = (id: string) => {
|
const removeItem = (id: string) => {
|
||||||
uploadAssets.update((uploadingAsset) => uploadingAsset.filter((a) => a.id != id));
|
uploadAssets.update((uploadingAsset) => {
|
||||||
|
const assetToRemove = uploadingAsset.find((a) => a.id === id);
|
||||||
|
if (assetToRemove) {
|
||||||
|
stats.update((stats) => {
|
||||||
|
switch (assetToRemove.state) {
|
||||||
|
case UploadState.DONE: {
|
||||||
|
stats.success--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case UploadState.DUPLICATED: {
|
||||||
|
stats.duplicates--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case UploadState.ERROR: {
|
||||||
|
stats.errors--;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stats.total--;
|
||||||
|
return stats;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return uploadingAsset.filter((a) => a.id != id);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const dismissErrors = () =>
|
const dismissErrors = () =>
|
||||||
|
|||||||
Reference in New Issue
Block a user