1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-28 05:18:38 +02:00

fix(web): show warning on duplicate uploads #2557 (#3613)

* fix(web): show warning on duplicate uploads #2557

* Prettier fix

* color

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Russell Tan
2023-08-09 18:11:26 -07:00
committed by GitHub
parent 57a7103d75
commit 66b2ad7939
5 changed files with 33 additions and 1 deletions

View File

@ -9,6 +9,7 @@
let showDetail = true;
let uploadLength = 0;
let duplicateCount = 0;
let isUploading = false;
// Reactive action to update asset uploadLength whenever there is a new one added to the list
@ -21,6 +22,10 @@
uploadAssetsStore.isUploading.subscribe((value) => {
isUploading = value;
});
uploadAssetsStore.duplicateCounter.subscribe((value) => {
duplicateCount = value;
});
</script>
{#if isUploading}
@ -32,6 +37,13 @@
message: 'Upload success, refresh the page to see new upload assets',
type: NotificationType.Info,
});
if (duplicateCount > 0) {
notificationController.show({
message: `Skipped ${duplicateCount} duplicate picture${duplicateCount > 1 ? 's' : ''}`,
type: NotificationType.Warning,
});
uploadAssetsStore.duplicateCounter.set(0);
}
}}
class="absolute bottom-6 right-6 z-[10000]"
>