mirror of
https://github.com/immich-app/immich.git
synced 2026-03-26 11:50:53 +03:00
fix: ignore errors deleting untitled album (#27020)
This commit is contained in:
@@ -273,7 +273,7 @@ export const handleDeleteAlbum = async (album: AlbumResponseDto, options?: { pro
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, $t('errors.unable_to_delete_album'));
|
handleError(error, $t('errors.unable_to_delete_album'), { notify });
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ export function standardizeError(error: unknown) {
|
|||||||
return error instanceof Error ? error : new Error(String(error));
|
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);
|
const standardizedError = standardizeError(error);
|
||||||
if (standardizedError.name === 'AbortError') {
|
if (standardizedError.name === 'AbortError') {
|
||||||
return;
|
return;
|
||||||
@@ -39,7 +40,9 @@ export function handleError(error: unknown, localizedMessage: string) {
|
|||||||
|
|
||||||
const errorMessage = serverMessage || localizedMessage;
|
const errorMessage = serverMessage || localizedMessage;
|
||||||
|
|
||||||
toastManager.danger(errorMessage);
|
if (notify) {
|
||||||
|
toastManager.danger(errorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user