Fix occasional commit then reboot screen (#1326)

This commit is contained in:
Tim Wilkinson 2024-08-19 17:44:49 -07:00 committed by GitHub
parent 53a63886d6
commit bb08c34948
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -63,6 +63,7 @@
Reboot required:
<button name="reboot" value="1" hx-get="/a/status/e/reboot" hx-target="body">Reboot</button>
</div>
<script>clearTimeout(window.commitRefresh);</script>
{% }
else if (changes > 0) {
%}
@ -76,7 +77,7 @@
htmx.on("#changes button[name=commit]", "click", e => {
e.target.innerText = "Committing ...";
htmx.find("#changes button[name=revert]").style.display = "none";
setTimeout(_ => htmx.ajax("GET", "/a/changes", "#changes"), 5000);
window.commitRefresh = setTimeout(_ => htmx.ajax("GET", "/a/changes", "#changes"), 5000);
});
})();
</script>