forked from angrykoala/gaucho
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
56 lines (47 loc) · 1.24 KB
/
app.js
File metadata and controls
56 lines (47 loc) · 1.24 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
"use strict";
const ipcRenderer = require('electron').ipcRenderer;
const TaskConfig = require('./app/renderer/task_config');
const Material = require('./app/renderer/materialize');
const components = {
"task-suite": require('./app/renderer/components/task_suite'),
"navbar": require('./app/renderer/components/navbar')
};
var mainWindow = null;
var client = require('electron-connect').client;
client.create(mainWindow);
let suites = [];
ipcRenderer.on('before-close', () => {
const promises = suites.map((s) => {
return s.stopAll();
});
promises.push(new Promise((resolve) => {
TaskConfig.saveConfig(() => {
resolve();
});
}));
Promise.all(promises).then(() => {
ipcRenderer.send("close-app");
});
});
const app = new Vue({ // jshint ignore:line
el: '#app',
data: {
suites: suites,
loaded: false
},
components: components,
mounted() {
Material.init();
TaskConfig.loadConfig((err, s) => {
if (err) console.error(err);
suites = s;
this.suites = suites;
this.loaded = true;
});
},
updated() {
this.$nextTick(() => {
Material.init();
});
}
});