Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

517 B
Raw Blame
import { useEffect, useState } from 'react';

/** A new navigation request opens search even when the task screen is reused. */
export function useSessionHistorySearch(openSearch: string | null, request: string | null) {
  const [searchOpen, setSearchOpen] = useState(openSearch === '1');
  useEffect(() => {
    if (openSearch === '1') setSearchOpen(true);
  }, [openSearch, request]);
  // Keep openSearch on the route: it also permits read-only invitation history.
  return [searchOpen, setSearchOpen] as const;
}