From c81a5ac0028514004b82db73ab6f01acbcfe48ba Mon Sep 17 00:00:00 2001 From: Fouad Date: Mon, 14 Aug 2023 09:42:27 +0100 Subject: [PATCH] Reset gateway performance on disconnect (#3620) * rest gateway performance on disconnect * update mobile context --- nym-connect/desktop/src/context/main.tsx | 6 ++++++ nym-connect/mobile/src/context/main.tsx | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/nym-connect/desktop/src/context/main.tsx b/nym-connect/desktop/src/context/main.tsx index dfa489d30c..ba6377e90b 100644 --- a/nym-connect/desktop/src/context/main.tsx +++ b/nym-connect/desktop/src/context/main.tsx @@ -164,9 +164,15 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => { } }, []); + const afterDisconnection = useCallback(async () => { + setGatewayPerformance('Good'); + setConnectedSince(undefined); + }, []); + const startDisconnecting = useCallback(async () => { try { await invoke('start_disconnecting'); + afterDisconnection(); } catch (e) { console.log(e); Sentry.captureException(e); diff --git a/nym-connect/mobile/src/context/main.tsx b/nym-connect/mobile/src/context/main.tsx index b999b957a2..10f6525685 100644 --- a/nym-connect/mobile/src/context/main.tsx +++ b/nym-connect/mobile/src/context/main.tsx @@ -116,9 +116,15 @@ export const ClientContextProvider: FCWithChildren = ({ children }) => { } }, []); + const afterDisconnection = useCallback(async () => { + setGatewayPerformance('Good'); + setConnectedSince(undefined); + }, []); + const startDisconnecting = useCallback(async () => { try { await invoke('start_disconnecting'); + afterDisconnection(); } catch (e) { console.log(e); }