@athenaintel/react 0.10.4 → 0.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -66590,16 +66590,26 @@ function useAthenaThreadManager() {
66590
66590
  const runtime = useAssistantRuntime({ optional: true });
66591
66591
  const threadId = useThread({ optional: true, selector: (s) => s.threadId });
66592
66592
  const threadList = useThreadList({ optional: true });
66593
- if (!runtime || !threadList) {
66594
- return null;
66595
- }
66596
- return {
66597
- activeThreadId: threadId ?? null,
66598
- threadIds: threadList.threadIds,
66599
- isLoading: threadList.isLoading,
66600
- switchToThread: (id) => runtime.threads.switchToThread(id),
66601
- switchToNewThread: () => runtime.threads.switchToNewThread()
66602
- };
66593
+ const switchToThread = useCallback(
66594
+ (id) => runtime.threads.switchToThread(id),
66595
+ [runtime]
66596
+ );
66597
+ const switchToNewThread = useCallback(
66598
+ () => runtime.threads.switchToNewThread(),
66599
+ [runtime]
66600
+ );
66601
+ return useMemo(() => {
66602
+ if (!runtime || !threadList) {
66603
+ return null;
66604
+ }
66605
+ return {
66606
+ activeThreadId: threadId ?? null,
66607
+ threadIds: threadList.threadIds,
66608
+ isLoading: threadList.isLoading,
66609
+ switchToThread,
66610
+ switchToNewThread
66611
+ };
66612
+ }, [runtime, threadId, threadList, switchToThread, switchToNewThread]);
66603
66613
  }
66604
66614
  function useAppendToComposer() {
66605
66615
  const aui = useAui();