Skip to content

Commit

Permalink
Fix notification always displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayquaza01 committed Feb 23, 2024
1 parent f0949b5 commit 7cf43a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 28 deletions.
21 changes: 2 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
v1.5.0 Changelog
v1.5.1 Changelog

* Redesigned options UI
* Options UI now respects colorscheme
* Added import/export to file buttons
* Added icons
* Additional information on options UI
* Displays when the extension last ran and the cutoff date
* Displays when the extension will next run
* Options are now available through a toolbar button
* Added timer trigger mode
* Timer mode causes history to be deleted on a set interval
* Might be made default in future version
* See: [#30 Manifest v3 (Chrome) - Idle Trigger](https://github.com/Rayquaza01/HistoryCleaner/issues/30)
* New required permission: notifications
* Previously was an optional permission
* If you set the notifications option, you will get a notification whenever history is cleared
* Notifications will not be sent otherwise
* New required permission: alarms
* Required for timer trigger mode
Fix bug where notification would always display when deleting all history (<a href="https://github.com/Rayquaza01/HistoryCleaner/issues/34">#34</a>)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "history-cleaner",
"version": "1.5.0",
"version": "1.5.1",
"description": "Firefox addon that deletes history older than a specified amount of days.",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 8 additions & 6 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,14 @@ async function deleteHistory(opts?: Options): Promise<void> {

console.log(notificationBody);

browser.notifications.create({
type: "basic",
iconUrl: "icons/icon-96.png",
title: browser.i18n.getMessage("historyDeletedNotification"),
message: notificationBody
});
if (res.notifications) {
browser.notifications.create({
type: "basic",
iconUrl: "icons/icon-96.png",
title: browser.i18n.getMessage("historyDeletedNotification"),
message: notificationBody
});
}

browser.storage.local.set({ lastRun: notificationBody });
}
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"manifest_version": 2,
"name": "__MSG_extensionName__",
"version": "1.5.0",
"version": "1.5.1",
"description": "__MSG_extensionDescription__",
"browser_specific_settings": {
"gecko": {
"id": "{a138007c-5ff6-4d10-83d9-0afaf0efbe5e}"
}
},
"icons": {
"16": "icons/icon.svg"
"96": "icons/icon-96.png"
},
"background": {
"scripts": ["browser-polyfill.min.js", "background.bundle.js"]
Expand Down

0 comments on commit 7cf43a5

Please sign in to comment.