forked from kriskbx/gitlab-time-tracker-taskbar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.js
More file actions
43 lines (41 loc) · 1020 Bytes
/
render.js
File metadata and controls
43 lines (41 loc) · 1020 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
39
40
41
42
43
const {ipcRenderer, shell} = require('electron');
window.state = {
data: {
running: false,
config: null,
projects: [],
issues: {},
mergeRequests: {},
project: null,
resource: null,
resourceType: true,
loadingProjects: false,
loadingResource: false,
loadingStatus: false,
loadingLog: false,
starting: false,
stopping: false,
cancelling: false,
version: false,
log: null,
platform: null
},
ipc: {
sync(key, args) {
return ipcRenderer.sendSync(key, args);
},
send(key, args) {
ipcRenderer.send(key, args);
},
on(key, func) {
ipcRenderer.on(key, func);
}
},
shell: {
open(url) {
shell.openExternal(url);
}
}
};
let cached = window.state.ipc.sync('cache-get', 'state');
if (cached) window.state.data = Object.assign(window.state.data, cached);