web: make the Settings Refresh reload the page
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user