Set badge count
This is displayed on the launcher icon on linux/mac // FREEBIE
This commit is contained in:
parent
d025b57656
commit
ea930d53ae
3 changed files with 9 additions and 2 deletions
|
@ -41,10 +41,10 @@
|
||||||
|
|
||||||
window.setUnreadCount = function(count) {
|
window.setUnreadCount = function(count) {
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
extension.navigator.setBadgeText(count);
|
window.setBadgeCount(count);
|
||||||
window.document.title = "Signal (" + count + ")";
|
window.document.title = "Signal (" + count + ")";
|
||||||
} else {
|
} else {
|
||||||
extension.navigator.setBadgeText("");
|
window.setBadgeCount(0);
|
||||||
window.document.title = "Signal";
|
window.document.title = "Signal";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
4
main.js
4
main.js
|
@ -173,3 +173,7 @@ app.on('activate', function () {
|
||||||
|
|
||||||
// In this file you can include the rest of your app's specific main process
|
// In this file you can include the rest of your app's specific main process
|
||||||
// code. You can also put them in separate files and require them here.
|
// code. You can also put them in separate files and require them here.
|
||||||
|
|
||||||
|
ipc.on('set-badge-count', function(event, count) {
|
||||||
|
app.setBadgeCount(count);
|
||||||
|
});
|
||||||
|
|
|
@ -8,6 +8,9 @@
|
||||||
const ipc = electron.ipcRenderer
|
const ipc = electron.ipcRenderer
|
||||||
window.config.locale_json = ipc.sendSync('locale-data');
|
window.config.locale_json = ipc.sendSync('locale-data');
|
||||||
|
|
||||||
|
window.setBadgeCount = function(count) {
|
||||||
|
ipc.send('set-badge-count', count);
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* Enables spell-checking and the right-click context menu in text editors.
|
* Enables spell-checking and the right-click context menu in text editors.
|
||||||
* Electron (`webFrame.setSpellCheckProvider`) only underlines misspelled words;
|
* Electron (`webFrame.setSpellCheckProvider`) only underlines misspelled words;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue