mirror of
https://github.com/Art051/immich.git
synced 2025-08-11 19:29:00 +00:00
removed multiple invocations of notification.
Added count to final notification which appears at the end of upload process.
This commit is contained in:
@@ -41,7 +41,7 @@
|
|||||||
});
|
});
|
||||||
} else if ($successCounter > 0) {
|
} else if ($successCounter > 0) {
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
message: 'Upload success, refresh the page to see new upload assets.',
|
message: `Uploaded ${$successCounter} assets successfully, refresh the page to see new upload assets.`,
|
||||||
type: NotificationType.Info,
|
type: NotificationType.Info,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,28 +25,13 @@ import { get } from 'svelte/store';
|
|||||||
import { handleError } from './handle-error';
|
import { handleError } from './handle-error';
|
||||||
|
|
||||||
export const addAssetsToAlbum = async (albumId: string, assetIds: string[]) => {
|
export const addAssetsToAlbum = async (albumId: string, assetIds: string[]) => {
|
||||||
const result = await addAssets({
|
await addAssets({
|
||||||
id: albumId,
|
id: albumId,
|
||||||
bulkIdsDto: {
|
bulkIdsDto: {
|
||||||
ids: assetIds,
|
ids: assetIds,
|
||||||
},
|
},
|
||||||
key: getKey(),
|
key: getKey(),
|
||||||
});
|
});
|
||||||
const count = result.filter(({ success }) => success).length;
|
|
||||||
notificationController.show({
|
|
||||||
type: NotificationType.Info,
|
|
||||||
timeout: 5000,
|
|
||||||
message:
|
|
||||||
count > 0
|
|
||||||
? `Added ${count} asset${count === 1 ? '' : 's'} to the album`
|
|
||||||
: `Asset${assetIds.length === 1 ? ' was' : 's were'} already part of the album`,
|
|
||||||
button: {
|
|
||||||
text: 'View Album',
|
|
||||||
onClick() {
|
|
||||||
return goto(`${AppRoute.ALBUMS}/${albumId}`);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addAssetsToNewAlbum = async (albumName: string, assetIds: string[]) => {
|
export const addAssetsToNewAlbum = async (albumName: string, assetIds: string[]) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user