forked from gitify-app/gitify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomms.js
More file actions
38 lines (31 loc) · 884 Bytes
/
Copy pathcomms.js
File metadata and controls
38 lines (31 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const { ipcRenderer, shell } = require('electron');
export function openExternalLink(url) {
shell.openExternal(url);
}
export function setAutoLaunch(value) {
if (value) {
ipcRenderer.send('startup-enable');
} else {
ipcRenderer.send('startup-disable');
}
}
export function updateTrayIcon(notificationsLength = 0) {
if (notificationsLength > 0) {
ipcRenderer.send('update-icon', 'TrayActive');
} else {
ipcRenderer.send('update-icon');
}
}
export function setBadge(notificationsLength) {
ipcRenderer.send('set-badge', notificationsLength);
}
export function reOpenWindow() {
ipcRenderer.send('reopen-window');
}
export function restoreSetting(setting, value) {
ipcRenderer.send(setting, value);
}
export function restoreSettings(settings) {
const showAppIcon = settings.get('showAppIcon');
restoreSetting('show-app-icon', showAppIcon);
}