only update currentState on certain types

This commit is contained in:
HorizonCode 2022-10-24 05:46:22 +02:00
parent 4f3eaddfc7
commit 2857345997

View File

@ -145,19 +145,21 @@ window.addEventListener('DOMContentLoaded', () => {
}) })
ipcRenderer.on('status_update', (event, status) => { ipcRenderer.on('status_update', (event, status) => {
currentState = status.type;
switch (status.type) { switch (status.type) {
case "up-to-date": case "up-to-date":
$("#launch-btn").attr('disabled', false); $("#launch-btn").attr('disabled', false);
$('#launch-btn').html('Launch'); $('#launch-btn').html('Launch');
currentState = status.type;
break; break;
case "update-available": case "update-available":
$("#launch-btn").attr('disabled', false); $("#launch-btn").attr('disabled', false);
$('#launch-btn').html('Update'); $('#launch-btn').html('Update');
currentState = status.type;
break; break;
case "missing-folder": case "missing-folder":
$("#launch-btn").attr('disabled', true); $("#launch-btn").attr('disabled', true);
$('#launch-btn').html('set your osu! folder'); $('#launch-btn').html('set your osu! folder');
currentState = status.type;
break; break;
case "error": case "error":
Swal.fire({ Swal.fire({