mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-11-09 16:01:42 +08:00
fix(tray): Do not show count on Mac OS X when 0. Fixes #1233
This commit is contained in:
parent
e5a424c5bf
commit
9bed0e6380
1 changed files with 8 additions and 1 deletions
|
|
@ -71,10 +71,17 @@ class TrayStore extends NylasStore {
|
||||||
const imgHandlers = {
|
const imgHandlers = {
|
||||||
'darwin': ()=> {
|
'darwin': ()=> {
|
||||||
const img = new Image();
|
const img = new Image();
|
||||||
|
var canvas = null;
|
||||||
|
|
||||||
// toDataUrl always returns the @1x image data, so the assets/darwin/
|
// toDataUrl always returns the @1x image data, so the assets/darwin/
|
||||||
// contains an "@2x" image /without/ the @2x extension
|
// contains an "@2x" image /without/ the @2x extension
|
||||||
img.src = this._baseIcon.toDataURL();
|
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();
|
const pngData = NativeImage.createFromDataURL(canvas.toDataURL()).toPng();
|
||||||
|
|
||||||
// creating from a buffer allows us to specify that the image is @2x
|
// creating from a buffer allows us to specify that the image is @2x
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue