From c578c68282471defa1d181658777b1706f5f4f88 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Mon, 5 Aug 2024 23:24:11 +0530 Subject: [PATCH] feat: pass all screenshot options --- src/components/organisms/RightSidePanel.tsx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/components/organisms/RightSidePanel.tsx b/src/components/organisms/RightSidePanel.tsx index ab57fe7b..b9271a0a 100644 --- a/src/components/organisms/RightSidePanel.tsx +++ b/src/components/organisms/RightSidePanel.tsx @@ -74,21 +74,16 @@ export const RightSidePanel = ({ pairForEdit }: RightSidePanelProps) => { } }, [stopGetText, createSettingsObject, socket]); - // Function to handle screenshot settings based on capture type const captureScreenshot = (fullPage: boolean) => { const screenshotSettings: ScreenshotSettings = { fullPage, - // Add other settings as required + type: 'png', + timeout: 30000, + animations: 'allow', + caret: 'hide', + scale: 'device', }; - socket?.emit('action', { action: 'takeScreenshot', settings: screenshotSettings }); - }; - - const handleCaptureFullpage = () => { - captureScreenshot(true); - }; - - const handleCaptureVisiblePart = () => { - captureScreenshot(false); + socket?.emit('action', { action: 'screenshot', settings: screenshotSettings }); }; return ( @@ -103,8 +98,8 @@ export const RightSidePanel = ({ pairForEdit }: RightSidePanelProps) => { {!getText && !getScreenshot && } {getScreenshot && ( - - + + )}