From a5cd8c7f6badbf3ad6964050ec9c873fc9a93f10 Mon Sep 17 00:00:00 2001 From: daniel-vahn Date: Mon, 27 May 2024 17:36:14 +0200 Subject: [PATCH] refactor: Update ConnectOverlay component to conditionally set connection state to 'disconnected' when closing the overlay --- src/components/connectOverlay/ConnectOverlay.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/connectOverlay/ConnectOverlay.tsx b/src/components/connectOverlay/ConnectOverlay.tsx index 1067e7e..729e0b3 100644 --- a/src/components/connectOverlay/ConnectOverlay.tsx +++ b/src/components/connectOverlay/ConnectOverlay.tsx @@ -63,7 +63,9 @@ const ConnectOverlay: React.FC = ({ // handle connect overlay close const handleClose = () => { - dispatch(setConnectionState('disconnected')); + if (connectionState === 'connecting') { + dispatch(setConnectionState('disconnected')); + } close(); };