From 5630e541e3f3ea8d46470d5bc40be07a7a68c814 Mon Sep 17 00:00:00 2001 From: Mees Frensel <33722705+meesfrensel@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:56:04 +0100 Subject: [PATCH] refactor(web): clean up (#32627) (cherry picked from commit 5ff8436781681755042fe6416024d0c4885b851d) --- i18n/en.json | 2 +- .../asset-viewer/ActivityViewer.svelte | 13 +++++-------- web/src/lib/utils/asset-utils.ts | 19 ++----------------- web/src/lib/utils/context-menu.ts | 2 +- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/i18n/en.json b/i18n/en.json index b70f998e9..8e5840a55 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2338,7 +2338,7 @@ "user": "User", "user_has_been_deleted": "This user has been deleted.", "user_id": "User ID", - "user_liked": "{user} liked {type, select, photo {this photo} video {this video} asset {this asset} other {it}}", + "user_liked": "{user} liked {type, select, image {this photo} video {this video} other {this}}", "user_pin_code_settings": "PIN Code", "user_pin_code_settings_description": "Manage your PIN code", "user_privacy": "User Privacy", diff --git a/web/src/lib/components/asset-viewer/ActivityViewer.svelte b/web/src/lib/components/asset-viewer/ActivityViewer.svelte index a9db0160f..e56e5ad83 100644 --- a/web/src/lib/components/asset-viewer/ActivityViewer.svelte +++ b/web/src/lib/components/asset-viewer/ActivityViewer.svelte @@ -7,10 +7,9 @@ import { Route } from '#lib/route.ts'; import { locale } from '#lib/stores/preferences.store.ts'; import { getAssetMediaUrl } from '#lib/utils.ts'; - import { getAssetType } from '#lib/utils/asset-utils.ts'; import { handleError } from '#lib/utils/handle-error.ts'; import { isTenMinutesApart } from '#lib/utils/timesince.ts'; - import { ReactionType, type ActivityResponseDto, type AlbumUserResponseDto, type AssetTypeEnum } from '@immich/sdk'; + import { AssetTypeEnum, ReactionType, type ActivityResponseDto, type AlbumUserResponseDto } from '@immich/sdk'; import { ContextMenuButton, Icon, IconButton, LoadingSpinner, Textarea, toastManager } from '@immich/ui'; import { mdiClose, mdiSend, mdiThumbUp, mdiTrashCanOutline } from '@mdi/js'; import * as luxon from 'luxon'; @@ -188,17 +187,15 @@ {/if} {:else if reaction.type === ReactionType.Like} + {const type = $derived( + assetType === AssetTypeEnum.Image || assetType === AssetTypeEnum.Video ? assetType.toLowerCase() : null, + )}