Compare commits

...

1 Commits

Author SHA1 Message Date
Jason Rasmussen
fd300cfc48 fix: ignore errors deleting untitled album 2026-03-18 13:35:20 -04:00
2 changed files with 6 additions and 3 deletions

View File

@@ -273,7 +273,7 @@ export const handleDeleteAlbum = async (album: AlbumResponseDto, options?: { pro
}
return true;
} catch (error) {
handleError(error, $t('errors.unable_to_delete_album'));
handleError(error, $t('errors.unable_to_delete_album'), { notify });
return false;
}
};

View File

@@ -23,7 +23,8 @@ export function standardizeError(error: unknown) {
return error instanceof Error ? error : new Error(String(error));
}
export function handleError(error: unknown, localizedMessage: string) {
export function handleError(error: unknown, localizedMessage: string, options?: { notify?: boolean }) {
const { notify = true } = options ?? {};
const standardizedError = standardizeError(error);
if (standardizedError.name === 'AbortError') {
return;
@@ -39,7 +40,9 @@ export function handleError(error: unknown, localizedMessage: string) {
const errorMessage = serverMessage || localizedMessage;
toastManager.danger(errorMessage);
if (notify) {
toastManager.danger(errorMessage);
}
return errorMessage;
} catch (error) {