mirror of
https://github.com/immich-app/immich.git
synced 2025-12-01 22:09:46 +09:00
feat: persistent memories (#15953)
feat: memories refactor chore: use heart as favorite icon fix: linting
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
AssetJobName,
|
||||
AssetMediaSize,
|
||||
JobName,
|
||||
MemoryType,
|
||||
finishOAuth,
|
||||
getAssetOriginalPath,
|
||||
getAssetPlaybackPath,
|
||||
@@ -16,6 +17,7 @@ import {
|
||||
linkOAuthAccount,
|
||||
startOAuth,
|
||||
unlinkOAuthAccount,
|
||||
type MemoryResponseDto,
|
||||
type PersonResponseDto,
|
||||
type SharedLinkResponseDto,
|
||||
type UserResponseDto,
|
||||
@@ -320,7 +322,14 @@ export const handlePromiseError = <T>(promise: Promise<T>): void => {
|
||||
};
|
||||
|
||||
export const memoryLaneTitle = derived(t, ($t) => {
|
||||
return (yearsAgo: number) => $t('years_ago', { values: { years: yearsAgo } });
|
||||
return (memory: MemoryResponseDto) => {
|
||||
const now = new Date();
|
||||
if (memory.type === MemoryType.OnThisDay) {
|
||||
return $t('years_ago', { values: { years: now.getFullYear() - memory.data.year } });
|
||||
}
|
||||
|
||||
return $t('unknown');
|
||||
};
|
||||
});
|
||||
|
||||
export const withError = async <T>(fn: () => Promise<T>): Promise<[undefined, T] | [unknown, undefined]> => {
|
||||
|
||||
Reference in New Issue
Block a user