Skip to content

Commit

Permalink
Fix FastGPT disappearing
Browse files Browse the repository at this point in the history
This fixes a problem where the FastGPT input would disappear if the user hadn't given permissions for the summarizer but had a Kagi session or token input, when coming back from the advanced settings (https://kagifeedback.org/d/3589-kagi-chrome-extension-fastgpt-disappears-after-returning-from-settings-pane).

Also updates dev dependencies.
  • Loading branch information
BrunoBernardino committed Mar 20, 2024
1 parent be2fbe1 commit 23462ff
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 50 deletions.
88 changes: 44 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
},
"homepage": "https://github.com/kagisearch/browser_extensions#readme",
"devDependencies": {
"@biomejs/biome": "1.5.3",
"adm-zip": "0.5.10",
"nodemon": "3.0.3"
"@biomejs/biome": "1.6.1",
"adm-zip": "0.5.12",
"nodemon": "3.1.0"
},
"engines": {
"node": "20.x",
Expand Down
8 changes: 5 additions & 3 deletions shared/src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,21 @@ async function setup() {
closeSettingsIcon.style.display = 'none';
tokenDiv.style.display = 'none';
if (tokenInput.value) {
fastGptSection.style.display = '';

const hasPermissions = await browser.permissions.contains({
permissions: ['activeTab'],
});

if (!hasPermissions) {
summarizeSection.style.display = 'none';
requestPermissionsSection.style.display = '';
fastGptSection.style.display = 'none';
} else {
summarizeSection.style.display = '';
requestPermissionsSection.style.display = 'none';
fastGptSection.style.display = '';
}
} else {
fastGptSection.style.display = 'none';
}
advancedToggle.setAttribute('title', 'Advanced settings');
} else {
Expand Down Expand Up @@ -369,7 +371,7 @@ async function setup() {
if (
platformInfo.os === 'android' &&
browserInfo?.version &&
parseInt(browserInfo.version, 10) <= 118
Number.parseInt(browserInfo.version, 10) <= 118
) {
requestPermissionsButton.addEventListener('click', () => {
alert('Cannot request activeTab permission on Android yet.');
Expand Down

0 comments on commit 23462ff

Please sign in to comment.