chore: remove un used code

This commit is contained in:
Sebastian Velez
2023-01-26 14:22:48 -05:00
parent c9c7aeb072
commit f7da028ddc

View File

@@ -1,18 +1,6 @@
import browser from 'webextension-polyfill'; import browser from 'webextension-polyfill';
import WakaTimeCore from './core/WakaTimeCore'; import WakaTimeCore from './core/WakaTimeCore';
// Add a listener to resolve alarms
browser.alarms.onAlarm.addListener(async (alarm) => {
// |alarm| can be undefined because onAlarm also gets called from
// window.setTimeout on old chrome versions.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (alarm?.name == 'heartbeatAlarm') {
console.log('recording a heartbeat - alarm triggered');
await WakaTimeCore.recordHeartbeat();
}
});
/** /**
* Whenever a active tab is changed it records a heartbeat with that tab url. * Whenever a active tab is changed it records a heartbeat with that tab url.
*/ */
@@ -28,8 +16,6 @@ browser.windows.onFocusChanged.addListener(async (windowId) => {
if (windowId != browser.windows.WINDOW_ID_NONE) { if (windowId != browser.windows.WINDOW_ID_NONE) {
console.log('recording a heartbeat - active window changed'); console.log('recording a heartbeat - active window changed');
await WakaTimeCore.recordHeartbeat(); await WakaTimeCore.recordHeartbeat();
} else {
console.log('lost focus');
} }
}); });