Skip to content

Commit

Permalink
Added browser support
Browse files Browse the repository at this point in the history
  • Loading branch information
ioay committed Dec 6, 2023
1 parent eede991 commit 62a8399
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
13 changes: 6 additions & 7 deletions background/services/notifications/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { uniqueId } from "lodash"
import browser from "webextension-polyfill"
import BaseService from "../base"
import PreferenceService from "../preferences"
import { ServiceCreatorFunction, ServiceLifecycleEvents } from "../types"
Expand Down Expand Up @@ -138,12 +139,10 @@ export default class NotificationsService extends BaseService<Events> {
...options,
}

browser.notifications.clear(notificationId).then(() => {
browser.notifications
.create(notificationId, notificationOptions)
.then(() => {
callback?.()
})
})
browser.notifications
.create(notificationId, notificationOptions)
.then(() => {
callback?.()
})
}
}
1 change: 1 addition & 0 deletions background/services/preferences/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import browser from "webextension-polyfill"
import { FiatCurrency } from "../../assets"
import { AddressOnNetwork, NameOnNetwork } from "../../accounts"
import { ServiceLifecycleEvents, ServiceCreatorFunction } from "../types"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"sinon": "^14.0.1",
"webext-options-sync": "^2.0.1",
"webext-redux": "^2.1.7",
"webextension-polyfill": "^0.7.0"
"webextension-polyfill": "^0.10.0"
},
"devDependencies": {
"@babel/core": "^7.22.11",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15639,10 +15639,10 @@ webext-redux@^2.1.7:
lodash.assignin "^4.2.0"
lodash.clonedeep "^4.5.0"

webextension-polyfill@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.7.0.tgz#0df1120ff0266056319ce1a622b09ad8d4a56505"
integrity sha512-su48BkMLxqzTTvPSE1eWxKToPS2Tv5DLGxKexLEVpwFd6Po6N8hhSLIvG6acPAg7qERoEaDL+Y5HQJeJeml5Aw==
webextension-polyfill@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz#ccb28101c910ba8cf955f7e6a263e662d744dbb8"
integrity sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g==

webextension-polyfill@^0.8.0:
version "0.8.0"
Expand Down

0 comments on commit 62a8399

Please sign in to comment.