Skip to content

Commit b5c3d23

Browse files
perf(web): the CLI command settings row compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7111501 commit b5c3d23

2 files changed

Lines changed: 18 additions & 20 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ export const REACT_COMPILED_FILES = [
9696
"apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx",
9797
"apps/web/src/components/ThreadTerminalDrawer.tsx",
9898
"apps/web/src/components/settings/SettingsPanels.tsx",
99+
"apps/web/src/components/settings/CliCommandSettingsRow.tsx",
99100
] as const;

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

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { DesktopCliCommandState } from "@t3tools/contracts";
2-
import { useCallback, useEffect, useState } from "react";
2+
import { useEffect, useState } from "react";
33

44
import { Button } from "../ui/button";
55
import { stackedThreadToast, toastManager } from "../ui/toast";
@@ -25,25 +25,22 @@ export function CliCommandSettingsRow() {
2525
};
2626
}, [bridge]);
2727

28-
const change = useCallback(
29-
(action: "install" | "uninstall") => {
30-
if (!bridge || pending) return;
31-
setPending(true);
32-
void bridge[action]()
33-
.then(setState)
34-
.catch((error: unknown) => {
35-
toastManager.add(
36-
stackedThreadToast({
37-
type: "error",
38-
title: action === "install" ? "Could not install t3" : "Could not remove t3",
39-
description: error instanceof Error ? error.message : "Something went wrong.",
40-
}),
41-
);
42-
})
43-
.finally(() => setPending(false));
44-
},
45-
[bridge, pending],
46-
);
28+
const change = (action: "install" | "uninstall") => {
29+
if (!bridge || pending) return;
30+
setPending(true);
31+
void bridge[action]()
32+
.then(setState)
33+
.catch((error: unknown) => {
34+
toastManager.add(
35+
stackedThreadToast({
36+
type: "error",
37+
title: action === "install" ? "Could not install t3" : "Could not remove t3",
38+
description: error instanceof Error ? error.message : "Something went wrong.",
39+
}),
40+
);
41+
})
42+
.finally(() => setPending(false));
43+
};
4744

4845
if (!bridge || !state?.supported) return null;
4946
const installed = state.installedPath !== null;

0 commit comments

Comments
 (0)