Skip to content

Commit

Permalink
fix: don't call checkTab if sidekick hidden from ui (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylandepass authored Jun 13, 2024
1 parent c823376 commit 15914fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
checkViewDocSource,
} from './actions.js';
import { addAuthTokenHeaders } from './auth.js';
import { getProjectMatches, getProjects } from './project.js';
import { updateIcon } from './ui.js';

chrome.action.onClicked.addListener(async ({ id }) => {
// toggle the sidekick when the action is clicked
Expand Down Expand Up @@ -55,7 +57,9 @@ chrome.runtime.onMessageExternal.addListener(async (message, sender, sendRespons
chrome.storage.onChanged.addListener(async (changes, storageArea) => {
if (storageArea === 'local' && changes.display) {
const tab = await getCurrentTab();
checkTab(tab.id);
const projects = await getProjects();
const matches = await getProjectMatches(projects, tab);
await updateIcon({ matches });
}
});

Expand Down
1 change: 1 addition & 0 deletions src/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
// Listen for display toggle events from application
sidekick.addEventListener('hidden', () => {
toggleDisplay();
sidekick.setAttribute('open', 'false');
});
}

Expand Down

0 comments on commit 15914fa

Please sign in to comment.