Reset gateway performance on disconnect (#3620)
* rest gateway performance on disconnect * update mobile context
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user