forked from angrykoala/gaucho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
48 lines (42 loc) · 1.24 KB
/
app.js
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
"use strict";
const ipcRenderer = require('electron').ipcRenderer;
const TaskConfig = require('./app/renderer/task_config');
const AppStatus = require('./app/renderer/app_status');
const Material = require('./app/renderer/materialize');
const components = {
"task-suite": require('./app/renderer/components/task_suite'),
"navbar": require('./app/renderer/components/navbar'),
"about": require('./app/renderer/components/about'),
"bottom-bar": require('./app/renderer/components/bottom_bar'),
"config-menu": require('./app/renderer/components/config_menu')
};
let suites = [];
ipcRenderer.on('before-close', () => {
TaskConfig.saveTasks();
const promises = suites.map((s) => {
return s.stopAll();
});
Promise.all(promises).then(() => {
ipcRenderer.send("close-app");
});
});
const app = new Vue({ // jshint ignore:line
el: '#app',
data: {
suites: suites,
loaded: false,
AppStatus: AppStatus
},
components: components,
mounted() {
Material.init();
TaskConfig.loadTasks();
this.suites = TaskConfig.suites;
this.loaded = true;
},
updated() {
this.$nextTick(() => {
Material.init();
});
}
});