From feb9d3abcac735feb0f338d8caef1237c8370ce9 Mon Sep 17 00:00:00 2001 From: Ambar Mutha <44284655+supercoww@users.noreply.github.com> Date: Wed, 5 Jan 2022 16:14:48 +0530 Subject: [PATCH] Ignore windows lock screen (#69) --- packages/desktop/electron/ignorelist.js | 3 +++ packages/desktop/electron/tracker.js | 5 +++++ packages/server/scripts/postbabel.js | 6 ------ 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 packages/desktop/electron/ignorelist.js delete mode 100644 packages/server/scripts/postbabel.js diff --git a/packages/desktop/electron/ignorelist.js b/packages/desktop/electron/ignorelist.js new file mode 100644 index 0000000..ed194c4 --- /dev/null +++ b/packages/desktop/electron/ignorelist.js @@ -0,0 +1,3 @@ +export const ignoreList = [ + /[A-Z]:\\Windows\\SystemApps\\Microsoft\.LockApp_[a-z0-9]+\\LockApp\.exe/, +]; diff --git a/packages/desktop/electron/tracker.js b/packages/desktop/electron/tracker.js index 5477eb9..cfe0cbe 100644 --- a/packages/desktop/electron/tracker.js +++ b/packages/desktop/electron/tracker.js @@ -2,6 +2,7 @@ import { JSONStorage } from './storage/json.js'; import { ServerStorage } from './storage/server.js'; import { ActiveWindowWatcher } from './watchers/active-window.js'; import getIcon from './getIcon.js'; +import { ignoreList } from './ignorelist.js'; export function startTracker() { const interval = 2000; @@ -12,6 +13,10 @@ export function startTracker() { ]; const activeWindowWatcher = new ActiveWindowWatcher(interval, activity => { + if (ignoreList.some(regex => regex.test(activity.path))) { + return; + } + for (const storage of storages) { storage.saveActivity(activity); } diff --git a/packages/server/scripts/postbabel.js b/packages/server/scripts/postbabel.js deleted file mode 100644 index f5485fc..0000000 --- a/packages/server/scripts/postbabel.js +++ /dev/null @@ -1,6 +0,0 @@ -import fs from 'fs'; -import cp from 'child_process'; - -fs.copyFileSync('dev.env', '.babel/dev.env'); -fs.writeFileSync('.babel/package.json', '{"type":"commonjs"}'); -cp.exec('cd ../ui && pnpm build');