Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix setDefaultOptions in updateToolbarButton #403

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Fixes:
- Corrected typo in build script, ensuring correct favicon path for Firefox releases([379](https://github.com/freelawproject/recap/issues/379), [397](https://github.com/freelawproject/recap-chrome/pull/397))
- Refines the generateFileName method to accurately compute zip file names ([366](https://github.com/freelawproject/recap/issues/366), [399](https://github.com/freelawproject/recap-chrome/pull/399)).
- Improves the reliability of PACER case ID retrieval on attachment pages ([369](https://github.com/freelawproject/recap/issues/369), [400](https://github.com/freelawproject/recap-chrome/pull/400)).
- Fix setDefaultOptions in updateToolbarButton([403](https://github.com/freelawproject/recap-chrome/pull/403))


For developers:
Expand Down
13 changes: 7 additions & 6 deletions src/utils/toolbar_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export function updateToolbarButton(tab) {
};

chrome.storage.local.get('options', function (items) {
if (!Object.keys(items).length) {
// Firefox 56 bug. The default settings didn't get created properly when
// upgrading from the legacy extension. This can be removed when everybody
// is safely beyond 56 (and the ESR)
setDefaultOptions({});
}

if (
'dismiss_news_badge' in items['options'] &&
items['options']['dismiss_news_badge']
Expand All @@ -52,12 +59,6 @@ export function updateToolbarButton(tab) {
});
return;
}
if (!Object.keys(items).length) {
// Firefox 56 bug. The default settings didn't get created properly when
// upgrading from the legacy extension. This can be removed when everybody
// is safely beyond 56 (and the ESR)
setDefaultOptions({});
}

if (items && items['options'] && !items['options']['recap_enabled']) {
setTitleIcon('RECAP is temporarily disabled', {
Expand Down
Loading