From 9610a9b01e41424d14ae7f7321687b915da744a1 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 13 Sep 2024 07:07:41 -0600 Subject: [PATCH] Fix right click --- web/src/components/card/AnimatedEventCard.tsx | 12 +++++++----- web/src/components/player/LivePlayer.tsx | 8 +++++--- web/src/components/player/PreviewThumbnailPlayer.tsx | 8 +++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/web/src/components/card/AnimatedEventCard.tsx b/web/src/components/card/AnimatedEventCard.tsx index 8ee4acdcf..fd8096ebc 100644 --- a/web/src/components/card/AnimatedEventCard.tsx +++ b/web/src/components/card/AnimatedEventCard.tsx @@ -135,11 +135,13 @@ export function AnimatedEventCard({
- window - .open(`${baseUrl}review?id=${event.id}`, "_blank") - ?.focus() - } + onAuxClick={(e) => { + if (e.button === 1) { + window + .open(`${baseUrl}review?id=${event.id}`, "_blank") + ?.focus(); + } + }} > {!alertVideos ? ( - window.open(`${baseUrl}#${cameraConfig.name}`, "_blank")?.focus() - } + onAuxClick={(e) => { + if (e.button === 1) { + window.open(`${baseUrl}#${cameraConfig.name}`, "_blank")?.focus(); + } + }} > {((showStillWithoutActivity && !liveReady) || liveReady) && ( <> diff --git a/web/src/components/player/PreviewThumbnailPlayer.tsx b/web/src/components/player/PreviewThumbnailPlayer.tsx index 69a6ac6df..5c9ccb0a2 100644 --- a/web/src/components/player/PreviewThumbnailPlayer.tsx +++ b/web/src/components/player/PreviewThumbnailPlayer.tsx @@ -177,9 +177,11 @@ export default function PreviewThumbnailPlayer({ onMouseOver={isMobile ? undefined : () => setIsHovered(true)} onMouseLeave={isMobile ? undefined : () => setIsHovered(false)} onClick={handleOnClick} - onAuxClick={() => - window.open(`${baseUrl}review?id=${review.id}`, "_blank")?.focus() - } + onAuxClick={(e) => { + if (e.button === 1) { + window.open(`${baseUrl}review?id=${review.id}`, "_blank")?.focus(); + } + }} {...swipeHandlers} > {playingBack && (