From 0c99e7fd6189df2aa4dae702d39cb1e5c855274c Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 24 Jul 2024 20:54:13 +0530 Subject: [PATCH] feat: render Highlighter if getText --- src/components/organisms/BrowserWindow.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/BrowserWindow.tsx b/src/components/organisms/BrowserWindow.tsx index a606326e..3a91f4de 100644 --- a/src/components/organisms/BrowserWindow.tsx +++ b/src/components/organisms/BrowserWindow.tsx @@ -5,6 +5,7 @@ import { useBrowserDimensionsStore } from "../../context/browserDimensions"; import { Highlighter } from "../atoms/Highlighter"; import { GenericModal } from '../atoms/GenericModal'; import { Button, Typography, Box } from '@mui/material'; +import { useActionContext } from '../../context/browserActions'; interface ConfirmationBoxProps { selector: string; @@ -40,8 +41,11 @@ export const BrowserWindow = () => { const [highlighterData, setHighlighterData] = useState<{ rect: DOMRect, selector: string } | null>(null); const [showConfirmation, setShowConfirmation] = useState(false); + const { socket } = useSocketStore(); const { width, height } = useBrowserDimensionsStore(); + const { getText, getScreenshot, resetActions } = useActionContext(); + console.log('Use browser dimensions:', width, height) @@ -139,7 +143,7 @@ export const BrowserWindow = () => { ) : null } - {(!showConfirmation && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ? + {(getText && !showConfirmation && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ?