Skip to content

Commit 1eebcba

Browse files
committed
fix(person-images): guard undefined clusterId and drop the any cast
Addresses CodeRabbit review on the PR: only treat the slice as synced when clusterId is defined, and type the query-data fallback explicitly instead of casting through any.
1 parent c85b57f commit 1eebcba

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

frontend/src/pages/PersonImages/PersonImages.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ export const PersonImages = () => {
5656
// page's images (issue #1315). Fall back to the cluster-scoped query data for
5757
// that window; read the slice once synced so favourite toggles still work.
5858
const personImages =
59-
loadedClusterId === clusterId
59+
clusterId !== undefined && loadedClusterId === clusterId
6060
? images
61-
: (((data?.data as any)?.images as Image[]) ?? []);
61+
: ((data?.data as { images?: Image[] })?.images ?? []);
6262

6363
const handleEditName = () => {
6464
setClusterName(clusterName);

0 commit comments

Comments
 (0)