mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-20 22:23:53 +08:00
fix(tray): Do not show count on Mac OS X when 0. Fixes #1233
This commit is contained in:
parent
ff42f06b92
commit
399f83bccc
1 changed files with 8 additions and 1 deletions
|
@ -71,10 +71,17 @@ class TrayStore extends NylasStore {
|
|||
const imgHandlers = {
|
||||
'darwin': ()=> {
|
||||
const img = new Image();
|
||||
var canvas = null;
|
||||
|
||||
// toDataUrl always returns the @1x image data, so the assets/darwin/
|
||||
// contains an "@2x" image /without/ the @2x extension
|
||||
img.src = this._baseIcon.toDataURL();
|
||||
const canvas = canvasWithSystemTrayIconAndText(img, this._unreadString);
|
||||
|
||||
if (this._unreadString === '0') {
|
||||
canvas = canvasWithSystemTrayIconAndText(img, '');
|
||||
} else {
|
||||
canvas = canvasWithSystemTrayIconAndText(img, this._unreadString);
|
||||
}
|
||||
const pngData = NativeImage.createFromDataURL(canvas.toDataURL()).toPng();
|
||||
|
||||
// creating from a buffer allows us to specify that the image is @2x
|
||||
|
|
Loading…
Reference in a new issue