mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
refactor: use primary toast
This commit is contained in:
@@ -435,23 +435,17 @@ export const toggleArchive = async (asset: AssetResponseDto) => {
|
|||||||
|
|
||||||
asset.isArchived = data.isArchived;
|
asset.isArchived = data.isArchived;
|
||||||
if (asset.isArchived) {
|
if (asset.isArchived) {
|
||||||
toastManager.custom(
|
toastManager.primary(
|
||||||
{
|
{
|
||||||
component: ToastAction,
|
|
||||||
props: {
|
|
||||||
title: $t('success'),
|
|
||||||
description: $t('added_to_archive'),
|
description: $t('added_to_archive'),
|
||||||
color: 'success',
|
|
||||||
button: {
|
button: {
|
||||||
color: 'secondary',
|
label: $t('undo'),
|
||||||
text: $t('undo'),
|
onclick: () =>
|
||||||
onClick: () =>
|
|
||||||
undoArchiveAssets([asset.id], () => {
|
undoArchiveAssets([asset.id], () => {
|
||||||
asset.isArchived = false;
|
asset.isArchived = false;
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
{ timeout: 5000 },
|
{ timeout: 5000 },
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -498,18 +492,12 @@ export const archiveAssets = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (visibility === AssetVisibility.Archive) {
|
if (visibility === AssetVisibility.Archive) {
|
||||||
toastManager.custom(
|
toastManager.primary(
|
||||||
{
|
{
|
||||||
component: ToastAction,
|
|
||||||
props: {
|
|
||||||
title: $t('success'),
|
|
||||||
description: $t('archived_count', { values: { count: ids.length } }),
|
description: $t('archived_count', { values: { count: ids.length } }),
|
||||||
color: 'success',
|
|
||||||
button: {
|
button: {
|
||||||
color: 'secondary',
|
label: $t('undo'),
|
||||||
text: $t('undo'),
|
onclick: () => undoArchiveAssets(ids, onUndoArchive),
|
||||||
onClick: () => undoArchiveAssets(ids, onUndoArchive),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ timeout: 5000 },
|
{ timeout: 5000 },
|
||||||
|
|||||||
Reference in New Issue
Block a user