Skip to content

Commit

Permalink
chore: remove useless null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
akhmadullin committed Feb 12, 2023
1 parent 86b6a82 commit af4ce1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const Gallery: FC<GalleryProps> = ({
},
] = entry
if (
(ref !== null && targetRef === ref) ||
targetRef === ref ||
(pid !== undefined && String(pid) === targetId)
) {
index = i
Expand All @@ -167,11 +167,11 @@ export const Gallery: FC<GalleryProps> = ({
src: original,
srcset: originalSrcset,
msrc: thumbnail,
element: ref.current,
thumbCropped: cropped,
content,
...(content !== undefined ? { type: 'html' } : {}),
...(pid !== undefined ? { pid } : {}),
...(ref.current !== null ? { element: ref.current } : {}),
...rest,
})
}
Expand Down

0 comments on commit af4ce1e

Please sign in to comment.