From 62a8399c8dec03230a0dba6e03c31f3a037d9008 Mon Sep 17 00:00:00 2001 From: ioay Date: Wed, 6 Dec 2023 18:38:54 +0100 Subject: [PATCH] Added browser support --- background/services/notifications/index.ts | 13 ++++++------- background/services/preferences/index.ts | 1 + package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/background/services/notifications/index.ts b/background/services/notifications/index.ts index 68af5a886..418b8aac4 100644 --- a/background/services/notifications/index.ts +++ b/background/services/notifications/index.ts @@ -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" @@ -138,12 +139,10 @@ export default class NotificationsService extends BaseService { ...options, } - browser.notifications.clear(notificationId).then(() => { - browser.notifications - .create(notificationId, notificationOptions) - .then(() => { - callback?.() - }) - }) + browser.notifications + .create(notificationId, notificationOptions) + .then(() => { + callback?.() + }) } } diff --git a/background/services/preferences/index.ts b/background/services/preferences/index.ts index 13f712e9f..93f37e92c 100644 --- a/background/services/preferences/index.ts +++ b/background/services/preferences/index.ts @@ -1,3 +1,4 @@ +import browser from "webextension-polyfill" import { FiatCurrency } from "../../assets" import { AddressOnNetwork, NameOnNetwork } from "../../accounts" import { ServiceLifecycleEvents, ServiceCreatorFunction } from "../types" diff --git a/package.json b/package.json index ca4965575..68211c016 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index dacad0c3d..8af999e4d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"