@@ -89,7 +89,7 @@ export const ChatRowContent = ({
8989 }
9090 } , [ isLast , message . say ] )
9191 const [ cost , apiReqCancelReason , apiReqStreamingFailedMessage ] = useMemo ( ( ) => {
92- if ( message . text && message . say === "api_req_started" ) {
92+ if ( message . text != null && message . say === "api_req_started" ) {
9393 const info : ClineApiReqInfo = JSON . parse ( message . text )
9494 return [ info . cost , info . cancelReason , info . streamingFailedMessage ]
9595 }
@@ -183,26 +183,26 @@ export const ChatRowContent = ({
183183 </ div >
184184 )
185185 return [
186- apiReqCancelReason !== null ? (
186+ apiReqCancelReason != null ? (
187187 apiReqCancelReason === "user_cancelled" ? (
188188 getIconSpan ( "error" , cancelledColor )
189189 ) : (
190190 getIconSpan ( "error" , errorColor )
191191 )
192- ) : cost !== null ? (
192+ ) : cost != null ? (
193193 getIconSpan ( "check" , successColor )
194194 ) : apiRequestFailedMessage ? (
195195 getIconSpan ( "error" , errorColor )
196196 ) : (
197197 < ProgressIndicator />
198198 ) ,
199- apiReqCancelReason !== null ? (
199+ apiReqCancelReason != null ? (
200200 apiReqCancelReason === "user_cancelled" ? (
201201 < span style = { { color : normalColor , fontWeight : "bold" } } > API Request Cancelled</ span >
202202 ) : (
203203 < span style = { { color : errorColor , fontWeight : "bold" } } > API Streaming Failed</ span >
204204 )
205- ) : cost !== null ? (
205+ ) : cost != null ? (
206206 < span style = { { color : normalColor , fontWeight : "bold" } } > API Request</ span >
207207 ) : apiRequestFailedMessage ? (
208208 < span style = { { color : errorColor , fontWeight : "bold" } } > API Request Failed</ span >
@@ -510,7 +510,7 @@ export const ChatRowContent = ({
510510 style = { {
511511 ...headerStyle ,
512512 marginBottom :
513- ( cost === null && apiRequestFailedMessage ) || apiReqStreamingFailedMessage
513+ ( cost == null && apiRequestFailedMessage ) || apiReqStreamingFailedMessage
514514 ? 10
515515 : 0 ,
516516 justifyContent : "space-between" ,
@@ -524,13 +524,13 @@ export const ChatRowContent = ({
524524 < div style = { { display : "flex" , alignItems : "center" , gap : "10px" , flexGrow : 1 } } >
525525 { icon }
526526 { title }
527- < VSCodeBadge style = { { opacity : cost ? 1 : 0 } } >
527+ < VSCodeBadge style = { { opacity : cost != null && cost > 0 ? 1 : 0 } } >
528528 ${ Number ( cost || 0 ) ?. toFixed ( 4 ) }
529529 </ VSCodeBadge >
530530 </ div >
531531 < span className = { `codicon codicon-chevron-${ isExpanded ? "up" : "down" } ` } > </ span >
532532 </ div >
533- { ( ( cost === null && apiRequestFailedMessage ) || apiReqStreamingFailedMessage ) && (
533+ { ( ( cost == null && apiRequestFailedMessage ) || apiReqStreamingFailedMessage ) && (
534534 < >
535535 < p style = { { ...pStyle , color : "var(--vscode-errorForeground)" } } >
536536 { apiRequestFailedMessage || apiReqStreamingFailedMessage }
0 commit comments