gitify icon indicating copy to clipboard operation
gitify copied to clipboard

feat: implement `showNotificationsCountInTray` setting

Open adufr opened this issue 1 year ago • 0 comments

Related issues

#750

Context

Introduce a new setting (disabled by default), that uses the tray.setTitle() API to show the notifications count next to the tray icon.

image

Discussion

There are quite a lot of changes because I had to pass settings into a few methods so that the updateTrayIcon() method could inherit them, as it now requires them.

It's also quite the mess in the ipcMain.on('update-icon') event handler, as I had to make sure the icon was refreshed whenever you enable/disable the setting, without losing the notifications count, which is not passed to the function it's not in the scope. (That's why props of updateTrayIcon() are optional)

If you have suggestions to make the implementation easier, please let me know.

I tried implementing some tests, I wanted to use the tray.getTitle() method to add more, but it looks like there's nowhere I could access the tray in the tests...

adufr avatar Feb 16 '24 17:02 adufr