From 8fc206d741ba495ce9c919afa2401849780c466b Mon Sep 17 00:00:00 2001 From: ttys0dev <126845556+ttys0dev@users.noreply.github.com> Date: Wed, 3 Apr 2024 14:35:09 -0600 Subject: [PATCH] Fix setBadgeText type error Fixes: Error: Type error for parameter details (Property "text" is required) for browserAction.setBadgeText. --- CHANGES.md | 1 + src/toolbar_button.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index b2f4e55c..3ad46584 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ Features: Changes: - Adds a badge to the extension icon and a banner in the popup to link users to a donate page with information about the pacer class action([#367](https://github.com/freelawproject/recap/issues/367), [#364](https://github.com/freelawproject/recap-chrome/pull/364)). + - Fix setBadgeText type error([#366](https://github.com/freelawproject/recap-chrome/pull/366)). Fixes: - None yet diff --git a/src/toolbar_button.js b/src/toolbar_button.js index 1dbfe0fe..95bce0fe 100644 --- a/src/toolbar_button.js +++ b/src/toolbar_button.js @@ -30,7 +30,7 @@ function updateToolbarButton(tab) { chrome.storage.local.get('options', function(items){ if ('dismiss_bagde' in items['options'] && items['options']['dismiss_bagde']) { - chrome.browserAction.setBadgeText({}); + chrome.browserAction.setBadgeText({ text: '' }); } else { chrome.browserAction.setBadgeText({ text: '🎁' }); }