From 5bf1a39b0ca4625a90ef70d73a811e55e92ff1e1 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sat, 9 Sep 2023 14:33:46 +0530 Subject: [PATCH] refactor --- .../photos/src/components/PhotoViewer/index.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/photos/src/components/PhotoViewer/index.tsx b/apps/photos/src/components/PhotoViewer/index.tsx index 19e92d944..d711f817a 100644 --- a/apps/photos/src/components/PhotoViewer/index.tsx +++ b/apps/photos/src/components/PhotoViewer/index.tsx @@ -554,6 +554,15 @@ function PhotoViewer(props: Iprops) { fullScreenApi.enter(); } }; + + const triggerManualConvert = () => { + props.getConvertedVideo( + photoSwipe, + photoSwipe.getCurrentIndex(), + photoSwipe.currItem as EnteFile + ); + }; + const scheduleUpdate = () => (needUpdate.current = true); const { id } = props; let { className } = props; @@ -587,13 +596,7 @@ function PhotoViewer(props: Iprops) { )} {showConvertBtn && ( { - props.getConvertedVideo( - photoSwipe, - photoSwipe.getCurrentIndex(), - photoSwipe.currItem as EnteFile - ); - }} + onClick={triggerManualConvert} disabled={!isSourceLoaded}> {t('CONVERT')}