Skip to content

High performance self-hosted photo and video management solution.

fix(web): suppress album upload notification (#10717)

Alex4193b0dede0f
diff --git a/web/src/lib/utils/asset-utils.ts b/web/src/lib/utils/asset-utils.ts
index da80f3c3b8..594fe09de7 100644
--- a/web/src/lib/utils/asset-utils.ts
+++ b/web/src/lib/utils/asset-utils.ts
@@ -28,7 +28,7 @@ import { t } from 'svelte-i18n';
import { get } from 'svelte/store';
import { handleError } from './handle-error';
-export const addAssetsToAlbum = async (albumId: string, assetIds: string[]) => {
+export const addAssetsToAlbum = async (albumId: string, assetIds: string[], showNotification = true) => {
const result = await addAssets({
id: albumId,
bulkIdsDto: {
@@ -38,20 +38,23 @@ export const addAssetsToAlbum = async (albumId: string, assetIds: string[]) => {
});
const count = result.filter(({ success }) => success).length;
const $t = get(t);
- notificationController.show({
- type: NotificationType.Info,
- timeout: 5000,
- message:
- count > 0
- ? $t('assets_added_to_album_count', { values: { count: count } })
- : $t('assets_were_part_of_album_count', { values: { count: assetIds.length } }),
- button: {
- text: $t('view_album'),
- onClick() {
- return goto(`${AppRoute.ALBUMS}/${albumId}`);
+
+ if (showNotification) {
+ notificationController.show({
+ type: NotificationType.Info,
+ timeout: 5000,
+ message:
+ count > 0
+ ? $t('assets_added_to_album_count', { values: { count: count } })
+ : $t('assets_were_part_of_album_count', { values: { count: assetIds.length } }),
+ button: {
+ text: $t('view_album'),
+ onClick() {
+ return goto(`${AppRoute.ALBUMS}/${albumId}`);
+ },
},
- },
- });
+ });
+ }
};
export const addAssetsToNewAlbum = async (albumName: string, assetIds: string[]) => {
diff --git a/web/src/lib/utils/file-uploader.ts b/web/src/lib/utils/file-uploader.ts
index 6e71539099..2d244e9bea 100644
--- a/web/src/lib/utils/file-uploader.ts
+++ b/web/src/lib/utils/file-uploader.ts
@@ -159,7 +159,7 @@ async function fileUploader(assetFile: File, albumId?: string, replaceAssetId?:
if (albumId) {
uploadAssetsStore.updateAsset(deviceAssetId, { message: $t('asset_adding_to_album') });
- await addAssetsToAlbum(albumId, [responseData.id]);
+ await addAssetsToAlbum(albumId, [responseData.id], false);
uploadAssetsStore.updateAsset(deviceAssetId, { message: $t('asset_added_to_album') });
}