refactored github handler, expanded scrtipable ui, expanded ui resposibillity on github api

This commit is contained in:
BuildTools
2023-02-06 18:12:49 +01:00
parent 3dbc1d7fa5
commit 15867de64d
5 changed files with 71 additions and 34 deletions

View File

@@ -1,8 +1,11 @@
window.electronAPI.updateProgress((_event, value) => {
console.log(_event)
console.log(value)
updateProgressStep(value);
})
});
window.electronAPI.updateFound((_event, value) => {
toggleDownloadButton(true);
updateLatestHeader(value.tag);
});
window.electronAPI.handleError((_event, value) => {
let error = `
@@ -20,7 +23,15 @@ window.electronAPI.handleError((_event, value) => {
`;
document.querySelector("body").innerHTML = error;
})
});
function updateLatestHeader(version) {
document.getElementById("latest").innerHTML = version;
}
function updateCurrentHeader(version) {
document.getElementById("installed").innerHTML = version;
}
function updateProgressBar(progress){
document.getElementById("progress-bar").style.width = progress + "%";