Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixes/release-v3852-basereds-1008d.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Release-branch hygiene: reset the connection test modal state in its open handler instead of the loading effect, clearing the react-hooks/set-state-in-effect lint error introduced with #15138.
10 changes: 6 additions & 4 deletions src/shared/components/ConnectionTestButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ export default function ConnectionTestButton({ connectionId, disabled, compact,
useEffect(() => {
if (!open) return;
const controller = new AbortController();
setLoading(true);
setError("");
setAnswer("");
setSaved(false);
Promise.all([
fetch(endpoint, { signal: controller.signal }).then(readResponse),
fetch(
Expand Down Expand Up @@ -113,6 +109,12 @@ export default function ConnectionTestButton({ connectionId, disabled, compact,
className={compact ? "!px-1" : "!px-2"}
onClick={(event) => {
event.stopPropagation();
// Reset the per-open state in the handler, not in the loading effect
// (react-hooks/set-state-in-effect).
setLoading(true);
setError("");
setAnswer("");
setSaved(false);
setOpen(true);
}}
>
Expand Down
Loading