Skip to content

Commit 8b254f3

Browse files
authored
Only register the notification click handler once (#267)
1 parent 61c2216 commit 8b254f3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

source/background.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ async function onTabUpdated(tabId, changeInfo, tab) {
9797
}
9898
}
9999

100+
function onNotificationClick(id) {
101+
openNotification(id);
102+
}
103+
100104
async function addHandlers() {
101105
const {updateCountOnNavigation} = await optionsStorage.getAll();
102106

103107
if (await queryPermission('notifications')) {
104-
browser.notifications.onClicked.addListener(id => {
105-
openNotification(id);
106-
});
108+
browser.notifications.onClicked.addListener(onNotificationClick);
107109
}
108110

109111
if (await queryPermission('tabs')) {

0 commit comments

Comments
 (0)