Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix: avoid rerendering chat rows on unrelated updates

Zhehui Bi5e81574e03e3
diff --git a/src/components/ChatView.tsx b/src/components/ChatView.tsx
index 3ceee8dcb3..b51d5a7a6d 100644
--- a/src/components/ChatView.tsx
+++ b/src/components/ChatView.tsx
@@ -333,11 +333,9 @@ const Bubble = memo(function Bubble({
replyTarget?: Message;
onReply: (message: Message) => void;
}) {
- const { botId, threadId, botName, voiceId, tts, localVoice, bots, mentionPeers, mentionPerson, focus, dispatch, onBranch, bubbleStyle, conversational, simple, canReact, openedAt, speakerViewer } = useChatRows(), busy = onRegenerate || versions ? use(ChatBusyContext) : false;
- const { state } = useStore();
- const sourceBusy = state.bots.find((candidate) => candidate.id === botId)?.tasks?.find((task) => task.threadId === threadId)?.busy ?? false;
+ const { botId, threadId, botName, voiceId, tts, localVoice, bots, mentionPeers, mentionPerson, focus, dispatch, onBranch, bubbleStyle, conversational, simple, canReact, openedAt, speakerViewer } = useChatRows(), busy = use(ChatBusyContext);
const forkAction = message.kind === "text" && !message.id.startsWith("optimistic-")
- ? [forkMessageItem({ kind: "bot", ownerId: botId, threadId, messageId: message.id }, dispatch, sourceBusy)] : [];
+ ? [forkMessageItem({ kind: "bot", ownerId: botId, threadId, messageId: message.id }, dispatch, busy)] : [];
const remoteClient = window.ogb?.remoteClient?.active === true;
const peer = peerLine(message) ?? peerRequest(message, botId);
const user = message.role === "user" && !peer;