diff --git a/projects/bp-gallery/src/components/views/picture/PictureView.tsx b/projects/bp-gallery/src/components/views/picture/PictureView.tsx index 034470cbf..26bfb7e8a 100644 --- a/projects/bp-gallery/src/components/views/picture/PictureView.tsx +++ b/projects/bp-gallery/src/components/views/picture/PictureView.tsx @@ -114,14 +114,15 @@ const PictureView = ({ pictureSequenceIds ); - const [hasPrevious, hasNext, hasPreviousInSequence, hasNextInSequence] = useMemo(() => { - return [ + const [hasPrevious, hasNext, hasPreviousInSequence, hasNextInSequence] = useMemo( + () => [ Boolean(getPreviousPictureId(pictureInSiblingsId, siblingIds)), Boolean(getNextPictureId(pictureInSiblingsId, siblingIds)), Boolean(getPreviousPictureId(pictureInSequenceId, pictureSequenceIds)), Boolean(getNextPictureId(pictureInSequenceId, pictureSequenceIds)), - ]; - }, [pictureInSequenceId, pictureInSiblingsId, pictureSequenceIds, siblingIds]); + ], + [pictureInSequenceId, pictureInSiblingsId, pictureSequenceIds, siblingIds] + ); const onNavigateMessage = useCallback( ({ pictureInSiblingsId, pictureInSequenceId }: PictureIds) => { diff --git a/projects/bp-gallery/src/hooks/prefetch.hook.ts b/projects/bp-gallery/src/hooks/prefetch.hook.ts index d2e75f93e..4af4b61f3 100644 --- a/projects/bp-gallery/src/hooks/prefetch.hook.ts +++ b/projects/bp-gallery/src/hooks/prefetch.hook.ts @@ -11,8 +11,8 @@ const usePrefetchPictureHook = ( siblings?: string[], pictureSequenceIds?: string[] ) => { - const [previousQuery] = useGetPictureInfoLazyQuery(); - const [nextQuery] = useGetPictureInfoLazyQuery(); + const [previousInSiblingsQuery] = useGetPictureInfoLazyQuery(); + const [nextInSiblingsQuery] = useGetPictureInfoLazyQuery(); const [previousInSequenceQuery] = useGetPictureInfoLazyQuery(); const [nextInSequenceQuery] = useGetPictureInfoLazyQuery(); @@ -20,7 +20,7 @@ const usePrefetchPictureHook = ( if (siblings?.includes(pictureInSiblingsId)) { const previousId = getPreviousPictureId(pictureInSiblingsId, siblings); if (previousId) { - previousQuery({ + previousInSiblingsQuery({ variables: { pictureId: previousId, }, @@ -28,7 +28,7 @@ const usePrefetchPictureHook = ( } const nextId = getNextPictureId(pictureInSiblingsId, siblings); if (nextId) { - nextQuery({ + nextInSiblingsQuery({ variables: { pictureId: nextId, }, @@ -56,8 +56,8 @@ const usePrefetchPictureHook = ( }, [ pictureInSiblingsId, siblings, - previousQuery, - nextQuery, + previousInSiblingsQuery, + nextInSiblingsQuery, pictureSequenceIds, pictureInSequenceId, previousInSequenceQuery, diff --git a/projects/bp-gallery/src/hooks/presentation-channel.hook.ts b/projects/bp-gallery/src/hooks/presentation-channel.hook.ts index 5b97e63f5..654a937c9 100644 --- a/projects/bp-gallery/src/hooks/presentation-channel.hook.ts +++ b/projects/bp-gallery/src/hooks/presentation-channel.hook.ts @@ -8,9 +8,7 @@ const usePresentationChannel = (id: string, onNavigate: (ids: PictureIds) => voi useEffect(() => { const consumer = channelFactory(id); producer.current = channelFactory(id); - consumer.onmessage = ( - event: MessageEvent<{ pictureInSiblingsId: string; pictureInSequenceId: string }> - ) => { + consumer.onmessage = (event: MessageEvent) => { onNavigate(event.data); };