Skip to content

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

Keep src/state/store.tsx within its size limit

milind-soniada00f6c3183
diff --git a/src/state/store.tsx b/src/state/store.tsx
index e5ce9a36b7..a86d020617 100644
--- a/src/state/store.tsx
+++ b/src/state/store.tsx
@@ -1691,12 +1691,7 @@ export function reducer(state: AppState, action: Action): AppState {
const threadId = action.threadId ?? bot?.threadId;
if (!bot || threadId !== bot.threadId) return animated;
if (bot.messages.some((message) => message.sendId === action.sendId)) return animated;
- const message = optimisticUserMessage(
- action.text,
- action.sendId,
- action.replyToId,
- bot.activeLeafId,
- );
+ const message = optimisticUserMessage(action.text, action.sendId, action.replyToId, bot.activeLeafId);
message.optimisticThreadOrderAt = bot.tasks?.find((task) => task.threadId === threadId)?.lastThreadOrderAt;
return bumpThreadUpdatedAt(updateBot(animated, bot.id, (current) => ({
...current,