@@ -39,7 +39,7 @@ function AppCard({
3939 < div >
4040 < div className = "flex items-center gap-2" >
4141 < h3 className = "font-semibold text-sm" > { app . name } </ h3 >
42- < span className = "text-xs text-muted-foreground" > ({ state } )</ span >
42+ { /* <span className="text-xs text-muted-foreground">({state})</span> */ }
4343 </ div >
4444 </ div >
4545 </ div >
@@ -75,28 +75,34 @@ function SidebarContent({ activeAppId }: { activeAppId?: string }) {
7575
7676 useEffect ( ( ) => {
7777 async function fetchToolStates ( ) {
78- if ( ! token ) return ;
79- setIsLoading ( true ) ;
80- // setError(undefined);
81- try {
82- const allStates = await checkToolState ( token ) ;
78+ if ( ! token ) {
8379 const states = Object . values ( TOOLS ) . map ( ( app ) => {
84- return [ app . id , allStates [ app . ds ] ] as const ;
80+ return [ app . id , 'available' ] as const ;
8581 } ) ;
8682 setToolStates ( Object . fromEntries ( states ) ) ;
87- } catch ( error ) {
88- if ( error instanceof InvalidTokenError ) {
89- // setError('Invalid token');
90- setToken ( null ) ;
91- } else {
92- console . error ( 'Failed to fetch tool states:' , error ) ;
93- // setError('Failed to fetch tool states');
83+ } else {
84+ setIsLoading ( true ) ;
85+ // setError(undefined);
86+ try {
87+ const allStates = await checkToolState ( token ) ;
88+ const states = Object . values ( TOOLS ) . map ( ( app ) => {
89+ return [ app . id , allStates [ app . ds ] ?? 'available' ] as const ;
90+ } ) ;
91+ setToolStates ( Object . fromEntries ( states ) ) ;
92+ } catch ( error ) {
93+ if ( error instanceof InvalidTokenError ) {
94+ // setError('Invalid token');
95+ setToken ( null ) ;
96+ } else {
97+ console . error ( 'Failed to fetch tool states:' , error ) ;
98+ // setError('Failed to fetch tool states');
99+ }
100+ } finally {
101+ setIsLoading ( false ) ;
94102 }
95- } finally {
96- setIsLoading ( false ) ;
97103 }
98104 }
99- if ( token ) fetchToolStates ( ) ;
105+ fetchToolStates ( ) ;
100106 } , [ token , setToken ] ) ;
101107
102108 return (
0 commit comments