Reset gateway performance on disconnect (#3620)

* rest gateway performance on disconnect

* update mobile context
This commit is contained in:
Fouad
2023-08-14 09:42:27 +01:00
committed by GitHub
parent 93a8e2a9bf
commit c81a5ac002
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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);
+6
View File
@@ -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);
}