1 Commits
Author SHA1 Message Date
sneak 905d20bb38 fix: Settings never shows "Saved." for a URL the input no longer shows (closes #695)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s
The RPC and Blockscout "Save" buttons in Settings now store nothing if the input no longer shows the URL that was checked. The input loses that URL when Settings is drawn again during the check, after another page changed a setting. Before this change, the typed URL was stored and "Saved." appeared while the input showed the previous URL.

The save compares the input and sets the URL in `state` in one step. A save refused because the network changed shows "The URL was not saved because the network changed." A save refused because the input changed shows "The URL was not saved because it was changed during the check."

Model: opus-5-5
2026-10-27 12:35:44 +00:00
+7 -7
View File
@@ -340,13 +340,13 @@ function showNewSettings() {
// the stored record too. "Saved." then means that the stored record holds // the stored record too. "Saved." then means that the stored record holds
// `url`. // `url`.
// //
// `input` is the id of the input that the user typed `url` in. When another // `input` is the id of the input that the user typed `url` in. This page draws
// page changes the network, "Use Blockscout" or "Check recipients on // Settings again after following another page's change to a setting. A redraw
// Etherscan", this page draws Settings again. A redraw during the endpoint // during the endpoint check puts the URL from `state` back in the input. So if
// check puts the URL from `state` back in the input. So if the input no longer // the input no longer shows `url`, nothing is saved. The flash message then
// shows `url`, nothing is saved. The flash message then says that the URL was // says that the URL was changed during the check. The save compares the input
// changed during the check. The save compares the input and sets `url` in // and sets `url` in `state` in one step. So a redraw after the comparison shows
// `state` in one step. So a redraw after the comparison shows `url`. // `url`.
async function saveEndpoint(field, input, url, networkId) { async function saveEndpoint(field, input, url, networkId) {
let refused = false; let refused = false;
let inputChanged = false; let inputChanged = false;