Skip to content

Commit

Permalink
Fix setDefaultOptions in updateToolbarButton
Browse files Browse the repository at this point in the history
  • Loading branch information
ttys0dev committed Oct 3, 2024
1 parent b714080 commit 8f5064a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
The following changes are not yet released, but are code complete:

Features:
- None yet
- Fix setDefaultOptions in updateToolbarButton([403](https://github.com/freelawproject/recap-chrome/pull/403))

Changes:
- Upgrade to CourtListener v4 API([380](https://github.com/freelawproject/recap/issues/380), [401](https://github.com/freelawproject/recap-chrome/pull/401))
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

0 comments on commit 8f5064a

Please sign in to comment.