mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(web): use derived instead of get(t) (#10884)
This commit is contained in:
parent
6791af8c2c
commit
3cd187dced
6 changed files with 16 additions and 18 deletions
|
|
@ -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 } });
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue