Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

656 B
Raw Blame
/**
 * Whether a thread row reads as "current".
 *
 * A row opens its thread in the Portal instead of switching the conversation,
 * so the Portal's thread is the row's current state; `activeThreadId` is only
 * the fallback for when the Portal shows no thread. OR-ing the two marked two
 * rows active at once whenever the conversation and the Portal were on
 * different threads.
 */
export const isThreadRowActive = ({
  activeThreadId,
  portalThreadId,
  threadId,
}: {
  activeThreadId?: null | string;
  portalThreadId?: null | string;
  threadId: string;
}): boolean => (portalThreadId ? threadId === portalThreadId : threadId === activeThreadId);