Skip to content

Commit

Permalink
Fix npm test failing
Browse files Browse the repository at this point in the history
random formatting changes to appease the formatter.
  • Loading branch information
PixeLInc committed Sep 25, 2024
1 parent 41b15a6 commit 555b500
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
19 changes: 10 additions & 9 deletions shared/src/background.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { summarizeContent, fetchSettings, requestActiveTabPermission } from './lib/utils.js';
import {
summarizeContent,
fetchSettings,
requestActiveTabPermission,
} from './lib/utils.js';

if (!globalThis.browser) {
globalThis.browser = chrome;
Expand Down Expand Up @@ -225,18 +229,15 @@ async function loadStorageData() {

sessionToken = token;

if (typeof token === 'undefined')
syncSessionFromExisting = true;
else
syncSessionFromExisting = sync_existing;
if (typeof token === 'undefined') syncSessionFromExisting = true;
else syncSessionFromExisting = sync_existing;

sessionApiToken = api_token;
sessionApiEngine = api_engine;
sessionSummaryType = summary_type;
sessionTargetLanguage = target_language;

if (!IS_CHROME)
sessionPrivacyConsent = privacy_consent;
if (!IS_CHROME) sessionPrivacyConsent = privacy_consent;
}

loadStorageData();
Expand Down Expand Up @@ -280,12 +281,12 @@ browser.contextMenus.create({
// Add a listener for the context menu item.
browser.contextMenus.onClicked.addListener(async (info, tab) => {
if (info.menuItemId === 'kagi-summarize') {
if (!IS_CHROME) { // Attach permission request to user input handler for Firefox
if (!IS_CHROME) {
// Attach permission request to user input handler for Firefox
await requestActiveTabPermission();
}
kagiSummarize(info, tab);
} else if (info.menuItemId === 'kagi-image-search') {
kagiImageSearch(info, tab);
}
});

6 changes: 5 additions & 1 deletion shared/src/popup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { fetchSettings, getActiveTab, requestActiveTabPermission } from './lib/utils.js';
import {
fetchSettings,
getActiveTab,
requestActiveTabPermission,
} from './lib/utils.js';

if (!globalThis.browser) {
globalThis.browser = chrome;
Expand Down

0 comments on commit 555b500

Please sign in to comment.