From e56cf962cab3db34257b70b92a103afd592f37dd Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Wed, 2 Mar 2022 15:59:10 -0500 Subject: [PATCH 1/4] Fix icon status not refreshing on chrome --- src/background/main.background.ts | 5 +++-- src/background/models/iconDetails.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/background/models/iconDetails.ts diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 369a965ce2..0897f3915a 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -87,6 +87,7 @@ import VaultTimeoutService from "../services/vaultTimeout.service"; import CommandsBackground from "./commands.background"; import ContextMenusBackground from "./contextMenus.background"; import IdleBackground from "./idle.background"; +import IconDetails from "./models/IconDetails"; import { NativeMessagingBackground } from "./nativeMessaging.background"; import NotificationBackground from "./notification.background"; import RuntimeBackground from "./runtime.background"; @@ -938,15 +939,15 @@ export default class MainBackground { return; } - const options = { + const options: IconDetails = { path: { 19: "images/icon19" + suffix + ".png", 38: "images/icon38" + suffix + ".png", }, - windowId: windowId, }; if (this.platformUtilsService.isFirefox()) { + options.windowId = windowId; await theAction.setIcon(options); } else if (this.platformUtilsService.isSafari()) { // Workaround since Safari 14.0.3 returns a pending promise diff --git a/src/background/models/iconDetails.ts b/src/background/models/iconDetails.ts new file mode 100644 index 0000000000..8d84a49e1e --- /dev/null +++ b/src/background/models/iconDetails.ts @@ -0,0 +1,8 @@ +export default class IconDetails { + path: { + 19: string; + 38: string; + }; + // Chrome does not support windowId, only FireFox + windowId?: number; +} From b02b35e1b519297c4b3096d061d1b804bcfae21b Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Wed, 2 Mar 2022 16:03:18 -0500 Subject: [PATCH 2/4] Fix import --- src/background/main.background.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background/main.background.ts b/src/background/main.background.ts index 0897f3915a..861f3f1ec3 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -87,7 +87,7 @@ import VaultTimeoutService from "../services/vaultTimeout.service"; import CommandsBackground from "./commands.background"; import ContextMenusBackground from "./contextMenus.background"; import IdleBackground from "./idle.background"; -import IconDetails from "./models/IconDetails"; +import IconDetails from "./models/iconDetails"; import { NativeMessagingBackground } from "./nativeMessaging.background"; import NotificationBackground from "./notification.background"; import RuntimeBackground from "./runtime.background"; From 7e432b40e24bd67b3536618eed569094a72be251 Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Wed, 2 Mar 2022 16:12:01 -0500 Subject: [PATCH 3/4] details, details --- src/background/models/iconDetails.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background/models/iconDetails.ts b/src/background/models/iconDetails.ts index 8d84a49e1e..6fa6c7d996 100644 --- a/src/background/models/iconDetails.ts +++ b/src/background/models/iconDetails.ts @@ -3,6 +3,6 @@ export default class IconDetails { 19: string; 38: string; }; - // Chrome does not support windowId, only FireFox + // Chrome does not support windowId, only Firefox windowId?: number; } From 51db742be71bc526a729f113b359a96fc704dd8c Mon Sep 17 00:00:00 2001 From: Robyn MacCallum Date: Wed, 2 Mar 2022 17:25:37 -0500 Subject: [PATCH 4/4] change class to interface --- src/background/models/iconDetails.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background/models/iconDetails.ts b/src/background/models/iconDetails.ts index 6fa6c7d996..3d60a735fc 100644 --- a/src/background/models/iconDetails.ts +++ b/src/background/models/iconDetails.ts @@ -1,4 +1,4 @@ -export default class IconDetails { +export default interface IconDetails { path: { 19: string; 38: string;