nextspace
    Preparing search index...

    Function useOpenThread

    • Tracks which thread is open in the split view, and closes it when its parent message leaves the list (an admin hid it and the reader is neither an admin nor its author), so the split layout does not stay open around an empty pane. A message that returns does not reopen it.

      Parameters

      • parentMessages: PseudonymousMessage[]

        The top-level messages the reader can see.

      Returns {
          selectedThread: PseudonymousMessage | null;
          selectedThreadId: string | null;
          setSelectedThreadId: Dispatch<SetStateAction<string | null>>;
      }

      The open thread's id and parent (null when none), and a setter for the id.