Skip to content

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

fix: tolerate unmounted conversation lists in fork links

Zhehui Bi3b3f3dbd22ed
diff --git a/src/components/ForkMessage.tsx b/src/components/ForkMessage.tsx
index d4eb4ae9f0..81d3a40f07 100644
--- a/src/components/ForkMessage.tsx
+++ b/src/components/ForkMessage.tsx
@@ -19,8 +19,8 @@ export function forkMessageItem(owner: Owner, dispatch: Dispatch<Action>, disabl
export function ForkLinks(owner: Owner) {
const { state, dispatch } = useStore();
const tasks = owner.kind === "bot"
- ? state.bots.find((bot) => bot.id === owner.ownerId)?.tasks
- : state.groups.find((group) => group.id === owner.ownerId)?.tasks;
+ ? state.bots?.find((bot) => bot.id === owner.ownerId)?.tasks
+ : state.groups?.find((group) => group.id === owner.ownerId)?.tasks;
const forks = tasks?.filter((task) => task.origin?.threadId === owner.threadId && task.origin.messageId === owner.messageId) ?? [];
if (!forks.length) return null;
return (