web: make the Settings Refresh reload the page

This commit is contained in:
2026-10-20 11:26:35 +01:00
parent 42d6e3aeb0
commit 443986498d
2 changed files with 2 additions and 23 deletions
+1 -22
View File
@@ -58,7 +58,7 @@ function renderSettingsView() {
class: "ghost settings-refresh",
type: "button",
text: "Refresh",
onclick: () => refreshSettingsStatus(),
onclick: () => window.location.reload(),
}),
),
renderSettingsConnection(),
@@ -272,27 +272,6 @@ function serverUrlSupportingText() {
* aria-invalid and the error tint) so an invalid Connect never needs a full
* re-render and the field being typed in is never rebuilt.
*/
/**
* Refresh the Settings page's live server facts. The page has no list to reload
* (its fields are local and its cards derive from the connection), so this sends
* the same ping the first connection uses and repaints the status card with the
* server's current build/time. It never reconnects or mutates a setting.
*/
async function refreshSettingsStatus() {
if (state.connection.kind === "connected") {
try {
const reply = await repo.ping();
state.serverProtocol = reply?.protocol ?? null;
state.serverBuild = reply?.build ?? null;
state.serverTime = reply?.time ?? null;
} catch {
// The connection card already carries the honest socket state; a ping
// failure must not replace it with a second, stale error line.
}
}
renderContent();
}
function refreshServerUrlError() {
const field = document.getElementById("settingsServerUrl");
const helper = document.getElementById("settingsUrlHelper");