Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

fix(photos):reset-search-cover-when-result-changes

Aswin Asok6f80b81a2713
diff --git a/web/apps/photos/src/components/SearchBar.tsx b/web/apps/photos/src/components/SearchBar.tsx
index fe1766ed2f..31e2df98af 100644
--- a/web/apps/photos/src/components/SearchBar.tsx
+++ b/web/apps/photos/src/components/SearchBar.tsx
@@ -587,6 +587,7 @@ const OptionContents = ({ data: option }: { data: SearchOption }) => {
const { suggestion, fileCount, previewFiles } = option;
const person = suggestion.type === "person" ? suggestion.person : undefined;
const hasCover = suggestion.type === "collection" || !!person;
+ const coverFile = person?.displayFaceFile ?? previewFiles[0];
return (
<Stack
@@ -614,8 +615,9 @@ const OptionContents = ({ data: option }: { data: SearchOption }) => {
}}
>
<ItemCard
+ key={`${coverFile?.id ?? "empty"}:${person?.displayFaceID ?? ""}`}
TileComponent={ResultCover}
- coverFile={person?.displayFaceFile ?? previewFiles[0]}
+ coverFile={coverFile}
coverFaceID={person?.displayFaceID}
/>
</Box>