Skip to content

Commit

Permalink
enable macOS badge count
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed May 17, 2018
1 parent 147bb39 commit a13c4b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/electron/main/ipc-main-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {isWebUri} from "valid-url";
import {promisify} from "util";
import {app, nativeImage, shell} from "electron";
import {KeePassHttpClient, Model as KeePassHttpClientModel} from "keepasshttp-client";
// TODO switch "keytar-prebuild" => "keytar" on https://github.com/atom/node-keytar/pull/67 resolving
import * as keytar from "keytar";
import * as Jimp from "jimp";

Expand Down Expand Up @@ -328,11 +327,13 @@ export const initEndpoints = (ctx: Context): EndpointsMap => {
const composedBuffer = await promisify(composedJimp.getBuffer.bind(composedJimp))(Jimp.MIME_PNG);
const composedNative = nativeImage.createFromBuffer(composedBuffer);

browserWindow.setOverlayIcon(overlayNative, `Unread messages ${String(count)}`);
browserWindow.setOverlayIcon(overlayNative, `Unread messages ${count}`);
tray.setImage(composedNative);
app.setBadgeCount(count);
} else {
browserWindow.setOverlayIcon(null as any, "");
tray.setImage(main.native);
app.setBadgeCount(0);
}
};
})(),
Expand Down

0 comments on commit a13c4b6

Please sign in to comment.