From 7e6afd35279a530a153a9dda83fc098c2da0a1f9 Mon Sep 17 00:00:00 2001 From: Sebastian Velez Date: Fri, 28 Apr 2023 09:33:12 -0500 Subject: [PATCH 1/7] Assert accessing id on an actual tab --- src/background.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/background.ts b/src/background.ts index 7a2d2fb..b778ca4 100644 --- a/src/background.ts +++ b/src/background.ts @@ -43,9 +43,12 @@ browser.windows.onFocusChanged.addListener(async (windowId) => { browser.tabs.onUpdated.addListener(async (tabId, changeInfo) => { if (changeInfo.status === 'complete') { // Get current tab URL. - const [tab] = await browser.tabs.query({ active: true, currentWindow: true }); + const tabs: browser.Tabs.Tab[] = await browser.tabs.query({ + active: true, + currentWindow: true, + }); // If tab updated is the same as active tab - if (tabId == tab.id) { + if (tabId == tabs[0]?.id) { await WakaTimeCore.recordHeartbeat(); } } From 6b9dd5c26e8b5d93ed68610cda1fec33557b8b00 Mon Sep 17 00:00:00 2001 From: Sebastian Velez Date: Fri, 28 Apr 2023 09:49:51 -0500 Subject: [PATCH 2/7] Display track social media input check correctly --- src/components/Options.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Options.tsx b/src/components/Options.tsx index c785c5c..d6aeb68 100644 --- a/src/components/Options.tsx +++ b/src/components/Options.tsx @@ -302,7 +302,7 @@ export default function Options(): JSX.Element {
setState({ ...state, trackSocialMedia: !state.trackSocialMedia })} > - + Track social media sites