Skip to content

Commit 63c43d6

Browse files
perf(web): provider setup section compile with the React Compiler
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 53892f1 commit 63c43d6

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@ export const REACT_COMPILED_FILES = [
8080
"apps/web/src/components/settings/useProjectScriptSettings.ts",
8181
"apps/web/src/components/settings/SnapShotSetupDialog.tsx",
8282
"apps/web/src/components/settings/NotificationSettings.tsx",
83+
"apps/web/src/components/settings/ProviderSetupSection.tsx",
8384
] as const;

‎apps/web/src/components/settings/ProviderSetupSection.tsx‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
isAtomCommandInterrupted,
3+
settlePromise,
34
squashAtomCommandFailure,
45
type AtomCommandResult,
56
} from "@t3tools/client-runtime/state/runtime";
@@ -155,23 +156,22 @@ function ProviderSetupActions({
155156
pendingRef.current = true;
156157
setPendingLabel(label);
157158
setError(null);
158-
try {
159-
const result = await request();
160-
if (result._tag === "Failure") {
161-
if (!isAtomCommandInterrupted(result)) {
162-
const failure = squashAtomCommandFailure(result);
163-
setError(failure instanceof Error ? failure.message : "Provider setup failed.");
164-
}
165-
return false;
166-
}
167-
return true;
168-
} catch {
159+
const settled = await settlePromise(request);
160+
pendingRef.current = false;
161+
setPendingLabel(null);
162+
if (settled._tag === "Failure") {
169163
setError("Provider setup failed. Try again.");
170164
return false;
171-
} finally {
172-
pendingRef.current = false;
173-
setPendingLabel(null);
174165
}
166+
const result = settled.value;
167+
if (result._tag === "Failure") {
168+
if (!isAtomCommandInterrupted(result)) {
169+
const failure = squashAtomCommandFailure(result);
170+
setError(failure instanceof Error ? failure.message : "Provider setup failed.");
171+
}
172+
return false;
173+
}
174+
return true;
175175
}
176176

177177
async function removeRuntime() {

0 commit comments

Comments
 (0)