Skip to content

Commit 047ddf7

Browse files
authored
Merge pull request RooCodeInc#676 from RooVetGit/revert_lint_changes_again
Revert lint changes again
2 parents d78da19 + 1a40050 commit 047ddf7

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# These owners will be the default owners for everything in the repo
2-
* @stea9499 @ColemanRoo @mrubens
2+
* @stea9499 @ColemanRoo @mrubens @cte

webview-ui/src/components/chat/ChatRow.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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,28 +183,26 @@ export const ChatRowContent = ({
183183
</div>
184184
)
185185
return [
186-
apiReqCancelReason ? (
186+
apiReqCancelReason != null ? (
187187
apiReqCancelReason === "user_cancelled" ? (
188188
getIconSpan("error", cancelledColor)
189189
) : (
190190
getIconSpan("error", errorColor)
191191
)
192-
) : cost ? (
192+
) : cost != null ? (
193193
getIconSpan("check", successColor)
194194
) : apiRequestFailedMessage ? (
195195
getIconSpan("error", errorColor)
196196
) : (
197197
<ProgressIndicator />
198198
),
199-
apiReqCancelReason ? (
199+
apiReqCancelReason != null ? (
200200
apiReqCancelReason === "user_cancelled" ? (
201201
<span style={{ color: normalColor, fontWeight: "bold" }}>API Request Cancelled</span>
202202
) : (
203-
<span style={{ color: errorColor, fontWeight: "bold" }}>
204-
API Streaming Failed ({JSON.stringify(apiReqCancelReason)})
205-
</span>
203+
<span style={{ color: errorColor, fontWeight: "bold" }}>API Streaming Failed</span>
206204
)
207-
) : cost ? (
205+
) : cost != null ? (
208206
<span style={{ color: normalColor, fontWeight: "bold" }}>API Request</span>
209207
) : apiRequestFailedMessage ? (
210208
<span style={{ color: errorColor, fontWeight: "bold" }}>API Request Failed</span>
@@ -512,7 +510,9 @@ export const ChatRowContent = ({
512510
style={{
513511
...headerStyle,
514512
marginBottom:
515-
(!cost && apiRequestFailedMessage) || apiReqStreamingFailedMessage ? 10 : 0,
513+
(cost == null && apiRequestFailedMessage) || apiReqStreamingFailedMessage
514+
? 10
515+
: 0,
516516
justifyContent: "space-between",
517517
cursor: "pointer",
518518
userSelect: "none",
@@ -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 && apiRequestFailedMessage) || apiReqStreamingFailedMessage) && (
533+
{((cost == null && apiRequestFailedMessage) || apiReqStreamingFailedMessage) && (
534534
<>
535535
<p style={{ ...pStyle, color: "var(--vscode-errorForeground)" }}>
536536
{apiRequestFailedMessage || apiReqStreamingFailedMessage}

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
275275
return true
276276
} else {
277277
const lastApiReqStarted = findLast(modifiedMessages, (message) => message.say === "api_req_started")
278-
if (lastApiReqStarted && lastApiReqStarted.text && lastApiReqStarted.say === "api_req_started") {
278+
if (lastApiReqStarted && lastApiReqStarted.text != null && lastApiReqStarted.say === "api_req_started") {
279279
const cost = JSON.parse(lastApiReqStarted.text).cost
280280
if (cost === undefined) {
281281
// api request has not finished yet
@@ -718,9 +718,9 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
718718
if (message.say === "api_req_started") {
719719
// get last api_req_started in currentGroup to check if it's cancelled. If it is then this api req is not part of the current browser session
720720
const lastApiReqStarted = [...currentGroup].reverse().find((m) => m.say === "api_req_started")
721-
if (lastApiReqStarted?.text) {
721+
if (lastApiReqStarted?.text != null) {
722722
const info = JSON.parse(lastApiReqStarted.text)
723-
const isCancelled = info.cancelReason !== null
723+
const isCancelled = info.cancelReason != null
724724
if (isCancelled) {
725725
endBrowserSession()
726726
result.push(message)

webview-ui/src/components/welcome/WelcomeView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const WelcomeView = () => {
1010

1111
const [apiErrorMessage, setApiErrorMessage] = useState<string | undefined>(undefined)
1212

13-
const disableLetsGoButton = !!apiErrorMessage
13+
const disableLetsGoButton = apiErrorMessage != null
1414

1515
const handleSubmit = () => {
1616
vscode.postMessage({ type: "apiConfiguration", apiConfiguration })

0 commit comments

Comments
 (0)