11import type { DesktopCliCommandState } from "@t3tools/contracts" ;
2- import { useCallback , useEffect , useState } from "react" ;
2+ import { useEffect , useState } from "react" ;
33
44import { Button } from "../ui/button" ;
55import { 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