From 296af7fad5047f6799c3a1590f54193ed9dc5ca9 Mon Sep 17 00:00:00 2001 From: Kiran Niranjan Date: Tue, 8 May 2018 16:14:33 +0530 Subject: [PATCH] Electron-445 - Move value to constant --- js/memoryMonitor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/memoryMonitor.js b/js/memoryMonitor.js index cbe38786..64c0f36a 100644 --- a/js/memoryMonitor.js +++ b/js/memoryMonitor.js @@ -6,7 +6,9 @@ const { getMainWindow, setIsAutoReload } = require('./windowMgr'); const systemIdleTime = require('@paulcbetts/system-idle-time'); const { getConfigField } = require('./config'); +const awayStatus = 'AWAY'; const maxMemory = 800; + let maxIdleTime = 4 * 60 * 1000; let reloadThreshold = 30 * 60 * 1000; let reloadedTimeStamp; @@ -65,7 +67,7 @@ function optimizeMemory(memoryInfo) { * @return {boolean} */ function isUserActive() { - return !(userPresenceStatus && userPresenceStatus === 'AWAY'); + return !(userPresenceStatus && userPresenceStatus === awayStatus); } /**