mirror of
https://github.com/immich-app/immich.git
synced 2025-12-01 09:49:53 +09:00
feat: user preferences for archive download size (#10296)
* feat: user preferences for archive download size * chore: open api * chore: clean up --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
@@ -301,3 +301,12 @@ export const handlePromiseError = <T>(promise: Promise<T>): void => {
|
||||
export const s = (count: number) => (count === 1 ? '' : 's');
|
||||
|
||||
export const memoryLaneTitle = (yearsAgo: number) => `${yearsAgo} year${s(yearsAgo)} ago`;
|
||||
|
||||
export const withError = async <T>(fn: () => Promise<T>): Promise<[undefined, T] | [unknown, undefined]> => {
|
||||
try {
|
||||
const result = await fn();
|
||||
return [undefined, result];
|
||||
} catch (error) {
|
||||
return [error, undefined];
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user