fix(web): file uploading error in album page (#550)

* feat(web): show upload error notification

* fix(web): album upload issue
This commit is contained in:
Thanh Pham 2022-08-31 20:12:31 +07:00 committed by GitHub
parent 75d2d82d05
commit f5f00e0f6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 9 deletions

View file

@ -44,12 +44,15 @@
if (uploadAssets.length == uploadAssetsCount) {
// Filter assets that are already in the album
const assetsToAdd = uploadAssets.filter(
(asset) => !assetsInAlbum.some((a) => a.id === asset)
(asset) => !!asset && !assetsInAlbum.some((a) => a.id === asset)
);
// Add the just uploaded assets to the album
dispatch('create-album', {
assets: assetsToAdd
});
if (assetsToAdd.length) {
dispatch('create-album', {
assets: assetsToAdd
});
}
// Clean up states.
albumUploadAssetStore.asset.set([]);