mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 17:25:35 +03:00
refactor(web): use derived instead of get(t) (#10884)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { PersonResponseDto } from '@immich/sdk';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { get } from 'svelte/store';
|
||||
import { derived } from 'svelte/store';
|
||||
|
||||
export const searchNameLocal = (
|
||||
name: string,
|
||||
@@ -27,7 +27,6 @@ export const searchNameLocal = (
|
||||
.slice(0, slice);
|
||||
};
|
||||
|
||||
export const getPersonNameWithHiddenValue = (name: string, isHidden: boolean) => {
|
||||
const $t = get(t);
|
||||
return $t('person_hidden', { values: { name: name, hidden: isHidden } });
|
||||
};
|
||||
export const getPersonNameWithHiddenValue = derived(t, ($t) => {
|
||||
return (name: string, isHidden: boolean) => $t('person_hidden', { values: { name: name, hidden: isHidden } });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user