Skip to content

Commit 3c8892e

Browse files
committed
react to the red dot and flash settings changing
1 parent acc53fa commit 3c8892e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/background.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const {
2121
savedWindowSize,
2222
savedWindowPosition,
2323
checkForUpdateOnLaunchEnabled,
24+
taskbarFlashEnabled,
2425
} = settings;
2526

2627
let mainWindow: BrowserWindow;
@@ -170,7 +171,7 @@ ipcMain.on("show-main-window", () => {
170171
});
171172

172173
ipcMain.on("flash-main-window-if-not-focused", () => {
173-
if (!mainWindow.isFocused()) {
174+
if (!mainWindow.isFocused() && taskbarFlashEnabled.value) {
174175
mainWindow.flashFrame(true);
175176
if (IS_MAC) {
176177
app.dock.setBadge("•");

src/helpers/trayManager.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const {
2626
seenMinimizeToTrayWarning,
2727
monochromeIconEnabled,
2828
showIconsInRecentConversationTrayEnabled,
29+
trayIconRedDotEnabled,
2930
} = settings;
3031

3132
export interface Conversation {
@@ -47,6 +48,9 @@ export class TrayManager {
4748
monochromeIconEnabled.subscribe(() =>
4849
this.tray?.setImage(this.getIconPath())
4950
);
51+
trayIconRedDotEnabled.subscribe(() => {
52+
this.tray?.setImage(this.getIconPath());
53+
});
5054
}
5155

5256
public startIfEnabled(): void {
@@ -125,7 +129,8 @@ export class TrayManager {
125129
if (IS_MAC) {
126130
filename = "icon_macTemplate.png";
127131
} else {
128-
const unread = this.messagesAreUnread ? "unread_" : "";
132+
const unread =
133+
this.messagesAreUnread && trayIconRedDotEnabled.value ? "unread_" : "";
129134
const mono = monochromeIconEnabled.value ? "_mono" : "";
130135
filename = `${unread}icon${mono}.png`;
131136
}
@@ -172,6 +177,7 @@ export class TrayManager {
172177
"startInTrayMenuItem",
173178
"monochromeIconEnabledMenuItem",
174179
"showIconsInRecentConversationTrayEnabledMenuItem",
180+
"trayIconRedDotEnabledMenuItem",
175181
];
176182

177183
if (newValue) {

0 commit comments

Comments
 (0)