From 92f5d2005c6c4f165712922ae2b4776e7f2c7cde Mon Sep 17 00:00:00 2001 From: MayGo Date: Wed, 22 Jan 2020 20:56:01 +0200 Subject: [PATCH] 3.6.2 online time fix --- client/src/components/TrayLayout/TrayMenu.tsx | 6 +++--- electron/app/API.ts | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/components/TrayLayout/TrayMenu.tsx b/client/src/components/TrayLayout/TrayMenu.tsx index 154f12d2..185c18ae 100644 --- a/client/src/components/TrayLayout/TrayMenu.tsx +++ b/client/src/components/TrayLayout/TrayMenu.tsx @@ -20,9 +20,9 @@ export const TrayMenu = () => { }; useEffect(() => { - const systemIsOnline = date => { - Logger.debug('system-is-online', date); - setOnlineSince(date ? date : getNow()); + const systemIsOnline = () => { + Logger.debug('system-is-online'); + setOnlineSince(getNow()); }; const systemIsNotOnline = () => { Logger.debug('system-is-not-online'); diff --git a/electron/app/API.ts b/electron/app/API.ts index f9e82613..25bd1c01 100644 --- a/electron/app/API.ts +++ b/electron/app/API.ts @@ -5,6 +5,7 @@ import { settingsService } from './services/settings-service'; import { appSettingService } from './services/app-setting-service'; import { trackItemService } from './services/track-item-service'; import { stateManager } from './state-manager'; +import { State } from './enums/state'; const settingsActions = { fetchAnalyserSettingsJsonString: async (req, res) => { @@ -73,7 +74,7 @@ const trackItemActions = { getOnlineStartTime: async (req, res) => { const statusItem = stateManager.getCurrentStatusTrackItem(); - res.send(statusItem ? statusItem.beginDate : null); + res.send(statusItem && statusItem.app === State.Online ? statusItem.beginDate : null); }, };