mirror of
https://github.com/immich-app/immich.git
synced 2025-12-01 15:59:51 +09:00
refactor(web): use derived instead of get(t) (#10884)
This commit is contained in:
@@ -317,10 +317,9 @@ export const handlePromiseError = <T>(promise: Promise<T>): void => {
|
||||
promise.catch((error) => console.error(`[utils.ts]:handlePromiseError ${error}`, error));
|
||||
};
|
||||
|
||||
export const memoryLaneTitle = (yearsAgo: number) => {
|
||||
const $t = get(t);
|
||||
return $t('years_ago', { values: { years: yearsAgo } });
|
||||
};
|
||||
export const memoryLaneTitle = derived(t, ($t) => {
|
||||
return (yearsAgo: number) => $t('years_ago', { values: { years: yearsAgo } });
|
||||
});
|
||||
|
||||
export const withError = async <T>(fn: () => Promise<T>): Promise<[undefined, T] | [unknown, undefined]> => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user