Skip to content

Commit f8ec824

Browse files
committed
Enforce strict equality checks and fix a minor link issue in App.tsx
1 parent 71f6882 commit f8ec824

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

frontend/src/App.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ function App() {
386386
for (const msg of conv.messages) {
387387
for (const msgPart of msg.parts) {
388388
if (
389-
msgPart.type == "toolCall" &&
390-
msgPart.toolCall.id == jsonData.params!.toolCallId
389+
msgPart.type === "toolCall" &&
390+
msgPart.toolCall.id === jsonData.params!.toolCallId
391391
) {
392392
msgPart.toolCall.outputJsonRpc = event.payload.data;
393393
}
@@ -406,10 +406,10 @@ function App() {
406406
await api.listen<string>(`gemini-output-${conversationId}`, (event) => {
407407
updateConversation(conversationId, (conv, lastMsg) => {
408408
conv.isStreaming = true;
409-
if (lastMsg.sender == "assistant") {
409+
if (lastMsg.sender === "assistant") {
410410
// There's an existing AI message.
411411
const lastPart = lastMsg.parts[lastMsg.parts.length - 1];
412-
if (lastPart?.type == "text") {
412+
if (lastPart?.type === "text") {
413413
lastPart.text += event.payload;
414414
} else {
415415
// Create a new text part.
@@ -438,9 +438,9 @@ function App() {
438438
await api.listen<string>(`gemini-thought-${conversationId}`, (event) => {
439439
updateConversation(conversationId, (conv, lastMsg) => {
440440
conv.isStreaming = true;
441-
if (lastMsg.sender == "assistant") {
441+
if (lastMsg.sender === "assistant") {
442442
const lastPart = lastMsg.parts[lastMsg.parts.length - 1];
443-
if (lastPart?.type == "thinking") {
443+
if (lastPart?.type === "thinking") {
444444
lastPart.thinking += event.payload;
445445
} else {
446446
// Create a new text part.
@@ -478,7 +478,7 @@ function App() {
478478
};
479479

480480
// Add tool call to the existing assistant message or create one if needed
481-
if (lastMsg.sender == "assistant") {
481+
if (lastMsg.sender === "assistant") {
482482
lastMsg.parts.push({
483483
type: "toolCall",
484484
toolCall: newToolCall,
@@ -508,8 +508,8 @@ function App() {
508508
for (const msg of conv.messages) {
509509
for (const msgPart of msg.parts) {
510510
if (
511-
msgPart.type == "toolCall" &&
512-
msgPart.toolCall.id == toolCallId
511+
msgPart.type === "toolCall" &&
512+
msgPart.toolCall.id === toolCallId
513513
) {
514514
// Split "finished" into "failed" or "completed".
515515
if (status === "finished") {
@@ -671,7 +671,7 @@ function App() {
671671
parts: [
672672
{
673673
type: "text",
674-
text: "Unfortunately, Gemini 2.5 Flash-Lite isn't usable due to thinking issues. See issues #1953](https://github.com/google-gemini/gemini-cli/issues/1953) and [#4548](https://github.com/google-gemini/gemini-cli/issues/4548) on the Gemini CLI repository for more details. PRs [#3033](https://github.com/google-gemini/gemini-cli/pull/3033) and [#4652](https://github.com/google-gemini/gemini-cli/pull/4652) resolve this issue.",
674+
text: "Unfortunately, Gemini 2.5 Flash-Lite isn't usable due to thinking issues. See issues [#1953](https://github.com/google-gemini/gemini-cli/issues/1953) and [#4548](https://github.com/google-gemini/gemini-cli/issues/4548) on the Gemini CLI repository for more details. PRs [#3033](https://github.com/google-gemini/gemini-cli/pull/3033) and [#4652](https://github.com/google-gemini/gemini-cli/pull/4652) resolve this issue.",
675675
},
676676
],
677677
sender: "assistant",
@@ -688,7 +688,9 @@ function App() {
688688
const history = recentMessages
689689
.map(
690690
(msg) =>
691-
`${msg.sender === "user" ? "User" : "Assistant"}: ${msg.content}`
691+
`${msg.sender === "user" ? "User" : "Assistant"}: ${
692+
msg.parts[0]?.type === "text" ? msg.parts[0].text : ""
693+
}`
692694
)
693695
.join("\n");
694696

@@ -777,7 +779,7 @@ function App() {
777779
};
778780

779781
updateConversation(activeConversation!, (conv, lastMsg) => {
780-
if (lastMsg.sender == "assistant") {
782+
if (lastMsg.sender === "assistant") {
781783
lastMsg.parts.push({ type: "toolCall", toolCall });
782784
} else {
783785
conv.messages.push({

0 commit comments

Comments
 (0)