-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
50 lines (39 loc) · 1.07 KB
/
main.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
49
50
const { app, BrowserWindow, Menu } = require('electron/main')
const {fetchRepositoryFiles} = require("./components/js/repoDatabase.js");
//Menu.setApplicationMenu(false); // Top Bar
let progressInterval
async function createWindow () {
const win = new BrowserWindow({
width: 1000,
height: 800
})
win.loadFile('index.html')
const fileTitles = await fetchRepositoryFiles();
console.log(fileTitles);
/*const INCREMENT = 0.03
const INTERVAL_DELAY = 100
let c = 0
progressInterval = setInterval(() => {
win.setProgressBar(c)
if (c < 2) {
c += INCREMENT
} else {
c = (-INCREMENT * 5)
}
}, INTERVAL_DELAY)*/
}
app.whenReady().then(createWindow)
// before the app is terminated, clear both timers
app.on('before-quit', () => {
clearInterval(progressInterval)
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})