Skip to content

Commit

Permalink
Attempt to fix the update button.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibz committed Feb 23, 2024
1 parent d1a269a commit c17be97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/backoffice/src/lib/components/settings/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
new ErrorHandler(true, () => inRequest = false));
}
$: updateButtonActive = lastVersion !== null && version !== lastVersion && !inRequest && !updateRequested && !updateRunning;
let updateAvailable = false;
function checkStatus(checkLastRelease: boolean) {
getStatus(checkLastRelease,
Expand All @@ -42,6 +42,8 @@
updateSuccess = usuccess;
updateFailed = ufailed;
updateAvailable = version !== lastVersion;
if (updateRequested || updateRunning) {
setTimeout(() => { checkStatus(false); }, 1000);
}
Expand Down Expand Up @@ -95,7 +97,7 @@
{/if}
</div>
<div class="flex justify-center items-center mt-8 h-15">
<button id="update-pm" class="btn btn-primary" class:btn-disabled={!updateButtonActive} on:click|preventDefault={update}>Update</button>
<button id="update-pm" class="btn btn-primary" class:btn-disabled={!updateAvailable || inRequest || updateRequested || updateRunning} on:click|preventDefault={update}>Update</button>
</div>
{:else}
<div class="items-center justify-center mt-8">
Expand Down

0 comments on commit c17be97

Please sign in to comment.