Skip to content

Commit 8dbc244

Browse files
committed
fix(settings): show the restart modal as soon as network settings save
StatusChecker polls /api/v1/status?checkUpdateAvailable=false, but saving network settings revalidated /api/v1/status, which is a different SWR key and nothing subscribes to it. The keys stopped matching in #3137 when the version check toggle was added, so since then the restart modal has only appeared on the next sixty second poll or on a fresh page load. The general settings cypress spec covered this and kept passing because earlier specs left the restart flag dirty, so the modal was already up when the spec loaded the page. Cleaning that up in #3368 removed the stale flag the spec was leaning on and the real gap surfaced.
1 parent 85984f7 commit 8dbc244

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/components/Settings/SettingsNetwork

src/components/Settings/SettingsNetwork/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ const SettingsNetwork = () => {
175175
apiRequestTimeout: Number(values.apiRequestTimeout) * 1000,
176176
});
177177
mutate('/api/v1/settings/public');
178-
mutate('/api/v1/status');
178+
// the key StatusChecker polls on, so the restart modal shows at once
179+
mutate('/api/v1/status?checkUpdateAvailable=false');
179180

180181
addToast(intl.formatMessage(messages.toastSettingsSuccess), {
181182
autoDismiss: true,

0 commit comments

Comments
 (0)