Improve UI feedback when removing packages (#1459)

This commit is contained in:
Tim Wilkinson 2024-09-03 23:13:35 -07:00 committed by GitHub
parent f616777111
commit c6d6024537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -355,6 +355,7 @@ const po = getPackageOptions();
}); });
htmx.on("#fetch-and-update", "click", e => { htmx.on("#fetch-and-update", "click", e => {
clearStatus(); clearStatus();
htmx.find("#fetch-and-update").disabled = true;
const upload = htmx.find("#package-update input[type=file]").files[0]; const upload = htmx.find("#package-update input[type=file]").files[0];
const download = htmx.find("#download-package").value; const download = htmx.find("#download-package").value;
const remove = htmx.find("#remove-package").value; const remove = htmx.find("#remove-package").value;
@ -392,6 +393,9 @@ const po = getPackageOptions();
htmx.ajax("GET", `{{request.env.REQUEST_URI}}?r=${remove}`, { htmx.ajax("GET", `{{request.env.REQUEST_URI}}?r=${remove}`, {
source: e.currentTarget, source: e.currentTarget,
swap: "none" swap: "none"
}).then(_ => {
htmx.find("#fetch-and-update").innerText = "Fetch and Install";
htmx.find("#remove-package").value = "-";
}); });
} }
}); });