From 072c389b3efec6f6acb1e55c8ab40d0735371cf6 Mon Sep 17 00:00:00 2001 From: Pavlo Buidenkov Date: Wed, 1 Jun 2022 00:31:52 +0200 Subject: [PATCH] fix reject connection bug --- app/components/StepsOfStepper/ScanQRStep.tsx | 1 - app/containers/DeskreenStepper.tsx | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/app/components/StepsOfStepper/ScanQRStep.tsx b/app/components/StepsOfStepper/ScanQRStep.tsx index d957cd3..9ba5e47 100644 --- a/app/components/StepsOfStepper/ScanQRStep.tsx +++ b/app/components/StepsOfStepper/ScanQRStep.tsx @@ -65,7 +65,6 @@ const ScanQRStep: React.FC = () => { ); if (roomId) { setRoomID(roomId); - clearInterval(getRoomIdInterval); } }, 1000); diff --git a/app/containers/DeskreenStepper.tsx b/app/containers/DeskreenStepper.tsx index 679f04c..27ca1a4 100644 --- a/app/containers/DeskreenStepper.tsx +++ b/app/containers/DeskreenStepper.tsx @@ -174,6 +174,7 @@ const DeskreenStepper = React.forwardRef((_props, ref) => { setPendingConnectionDevice(null); setIsUserAllowedConnection(false); + ipcRenderer.invoke(IpcEvents.ResetWaitingForConnectionSharingSession); ipcRenderer.invoke(IpcEvents.CreateWaitingForConnectionSharingSession); }, []); @@ -186,14 +187,11 @@ const DeskreenStepper = React.forwardRef((_props, ref) => { ipcRenderer.invoke(IpcEvents.CreateWaitingForConnectionSharingSession); }, []); - React.useImperativeHandle(ref, () => ({ - handleReset() { - handleResetWithSharingSessionRestart(); - }, - })); - const handleCancelAlert = async () => { setIsAlertOpen(false); + setActiveStep(0); + setPendingConnectionDevice(null); + setIsUserAllowedConnection(false); ipcRenderer.invoke(IpcEvents.ResetWaitingForConnectionSharingSession); ipcRenderer.invoke(IpcEvents.CreateWaitingForConnectionSharingSession);