Skip to content

Commit 4116a2b

Browse files
fix(web): keep computer use handlers compatible with React Compiler
1 parent b3e0acf commit 4116a2b

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ export function CuaSetupDialog({
7272
await onAllow(target);
7373
} catch {
7474
setError("Could not open System Settings. Try Allow again.");
75-
} finally {
76-
pending.current = false;
77-
setBusy(false);
7875
}
76+
pending.current = false;
77+
setBusy(false);
7978
};
8079
const finish = async () => {
8180
if (pending.current || !ready) return;
@@ -87,10 +86,9 @@ export function CuaSetupDialog({
8786
onClose();
8887
} catch (error) {
8988
setError(error instanceof Error ? error.message : "Could not save the setting. Try again.");
90-
} finally {
91-
pending.current = false;
92-
setBusy(false);
9389
}
90+
pending.current = false;
91+
setBusy(false);
9492
};
9593
return (
9694
<Dialog

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,13 +1183,10 @@ function ComputerUseControls() {
11831183

11841184
const save = async (enableCua: boolean) => {
11851185
setSaving(true);
1186-
try {
1187-
const result = await updateSettings({ enableCua });
1188-
refresh();
1189-
return result;
1190-
} finally {
1191-
setSaving(false);
1192-
}
1186+
const result = await updateSettings({ enableCua });
1187+
refresh();
1188+
setSaving(false);
1189+
return result;
11931190
};
11941191

11951192
return (

0 commit comments

Comments
 (0)