fix: ignore errors deleting untitled album (#27020)

This commit is contained in:
Jason Rasmussen
2026-03-19 12:55:43 -04:00
committed by GitHub
parent b30373b24f
commit 29000461c2
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) {