Electron 32 (Activity Detection) (#71)

* Implemented user activity detection

* ELECTRON-32: Implemented throttle function

* ELECTRON-32: Fixed some bugs in throttle function

* ELECTRON-32: Updated comments

* ELECTRON-32: Fixed clear interval bug

* ELECTRON-32: Updated as per the review

* ELECTRON-32: Updated return statement

* ELECTRON-32: Added a boolean to the callback function

* ELECTRON-32: Resolved conflicts

* ELECTRON-32 - Added period attribute
This commit is contained in:
Kiran Niranjan
2017-05-09 00:00:45 +05:30
committed by Lynn
parent 92822fec3f
commit 4087eb3acc
7 changed files with 171 additions and 33 deletions

View File

@@ -8,6 +8,7 @@ const electron = require('electron');
const windowMgr = require('./windowMgr.js');
const log = require('./log.js');
const activityDetection = require('./activityDetection/activityDetection');
const badgeCount = require('./badgeCount.js');
const apiEnums = require('./enums/api.js');
@@ -87,11 +88,16 @@ electron.ipcMain.on(apiName, (event, arg) => {
// renderer window that has a registered logger from JS.
log.setLogWindow(event.sender);
}
if (arg.cmd === apiCmds.registerActivityDetection) {
// renderer window that has a registered activity detection from JS.
activityDetection.setActivityWindow(arg.period, event.sender);
}
});
// expose these methods primarily for testing...
module.exports = {
shouldCheckValidWindow: function(shouldCheck) {
shouldCheckValidWindow: function (shouldCheck) {
checkValidWindow = shouldCheck;
}
}