From 3343f0f30659beccce840c573df9209e494f5f23 Mon Sep 17 00:00:00 2001 From: Ming Date: Mon, 13 Sep 2021 17:56:03 -0400 Subject: [PATCH] Some client app bug fixes (#3871) * linted * delete accidental files --- client-applications/src/main/flows/index.ts | 12 +++--------- client-applications/src/utils/protocol.ts | 2 +- client-applications/src/utils/windows.ts | 6 +++++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/client-applications/src/main/flows/index.ts b/client-applications/src/main/flows/index.ts index 55329009a36..4fb529ede1d 100644 --- a/client-applications/src/main/flows/index.ts +++ b/client-applications/src/main/flows/index.ts @@ -17,15 +17,9 @@ const update = autoUpdateFlow(fromTrigger("updateAvailable")) // If there's no update, get the auth credentials (access/refresh token) const auth = authFlow( - fromSignal( - merge( - fromSignal(fromTrigger("authInfo"), fromTrigger(TRIGGER.notPersisted)), - fromTrigger(TRIGGER.persisted) - ), - merge( - fromTrigger(TRIGGER.updateNotAvailable), - fromTrigger(TRIGGER.updateError) - ) + merge( + fromSignal(fromTrigger("authInfo"), fromTrigger(TRIGGER.notPersisted)), + fromTrigger(TRIGGER.persisted) ) ) diff --git a/client-applications/src/utils/protocol.ts b/client-applications/src/utils/protocol.ts index a554675b6a8..3afa399bd29 100644 --- a/client-applications/src/utils/protocol.ts +++ b/client-applications/src/utils/protocol.ts @@ -13,7 +13,7 @@ import { spawn, ChildProcess } from "child_process" import config, { loggingFiles } from "@app/config/environment" import { electronLogPath, protocolToLogz } from "@app/utils/logging" -const NACK_LOOKBACK_PERIOD = 3 // Number of seconds to look back when measuring # of nacks +const NACK_LOOKBACK_PERIOD = 2 // Number of seconds to look back when measuring # of nacks const MAX_NACKS_ALLOWED = 6 // Maximum # of nacks allowed before we decide the network is unstable let protocolConnected = false diff --git a/client-applications/src/utils/windows.ts b/client-applications/src/utils/windows.ts index 88a3d0179cb..12c6e74a101 100644 --- a/client-applications/src/utils/windows.ts +++ b/client-applications/src/utils/windows.ts @@ -103,7 +103,11 @@ export const getNumberWindows = () => { export const closeElectronWindows = (windows?: BrowserWindow[]) => { const windowsToClose = windows ?? getElectronWindows() windowsToClose.forEach((win: BrowserWindow) => { - win.close() + try { + win.close() + } catch (err) { + console.error(err) + } }) }