summaryrefslogtreecommitdiff
path: root/src/renderer/index.ts
blob: f83bd3f53c943dc1f5435f0bc6eb39cab9c54129 (plain) (blame)
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
import { ipcRenderer } from 'electron';

const quitBtn = document.getElementById('quit');

quitBtn.addEventListener('click', () => {
  ipcRenderer.send('quit');
});

const minimizeBtn = document.getElementById('minimize');

minimizeBtn.addEventListener('click', () => {
  minimizeBtn.blur();
  ipcRenderer.send('minimize');
});

document.ondragover = document.ondrop = (event) => {
  event.preventDefault();
};


const debugBtn = document.getElementById('debug');

//debugBtn.hidden = true;

debugBtn.addEventListener('click', () => {
  debugBtn.blur();
  ipcRenderer.send('debug');
});

const activityLabel = document.getElementById('activity');
const progressBar =  document.getElementById('progress') as HTMLProgressElement;
ipcRenderer.on('status-update', (event:any, status:any) => {
  activityLabel.innerText = status.activity;
  if(status.ActivityIsError)
    activityLabel.classList.add("error");
  else
    activityLabel.classList.remove("error");
  progressBar.value = status.progress;
})