added error handling
This commit is contained in:
20
render.js
20
render.js
@@ -1,9 +1,27 @@
|
||||
window.electronAPI.updateProgress(async (_event, value) => {
|
||||
window.electronAPI.updateProgress((_event, value) => {
|
||||
console.log(_event)
|
||||
console.log(value)
|
||||
updateProgressStep(value);
|
||||
})
|
||||
|
||||
window.electronAPI.handleError((_event, value) => {
|
||||
let error = `
|
||||
<div class="titlebar">NCOS Companion</div>
|
||||
<div class="content">
|
||||
<h1 class="centered">An Error Occured</h1>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<h4 class="centered">${value.label}</h4>
|
||||
<h4 class="centered">pleas report this to <a class="link" target="_blank" href="https://github.com/Vortex-Dynamics/NervUpdaterClient/issues">us</a></h4>
|
||||
<pre class="centered">${value.err}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.querySelector("body").innerHTML = error;
|
||||
})
|
||||
|
||||
function updateProgressBar(progress){
|
||||
document.getElementById("progress-bar").style.width = progress + "%";
|
||||
document.getElementById("progress-label").textContent = progress + "%";
|
||||
|
||||
Reference in New Issue
Block a user