@athenaintel/react 0.10.6 → 0.10.8
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.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -66627,9 +66627,12 @@ function ThreadListItem() {
|
|
|
66627
66627
|
}
|
|
66628
66628
|
function useAthenaThreadManager() {
|
|
66629
66629
|
const runtime = useAssistantRuntime({ optional: true });
|
|
66630
|
-
const
|
|
66631
|
-
|
|
66632
|
-
|
|
66630
|
+
const remoteId = useThread({ optional: true, selector: (s) => {
|
|
66631
|
+
var _a2;
|
|
66632
|
+
return (_a2 = s.metadata) == null ? void 0 : _a2.remoteId;
|
|
66633
|
+
} });
|
|
66634
|
+
const isThreadLoading = useThread({ optional: true, selector: (s) => s.isLoading }) ?? false;
|
|
66635
|
+
const isListLoading = useThreadList({ optional: true, selector: (s) => s.isLoading });
|
|
66633
66636
|
const runtimeRef = React.useRef(runtime);
|
|
66634
66637
|
runtimeRef.current = runtime;
|
|
66635
66638
|
const switchToThread = React.useCallback(
|
|
@@ -66640,19 +66643,19 @@ function useAthenaThreadManager() {
|
|
|
66640
66643
|
() => runtimeRef.current.threads.switchToNewThread(),
|
|
66641
66644
|
[]
|
|
66642
66645
|
);
|
|
66643
|
-
const activeThreadId =
|
|
66646
|
+
const activeThreadId = remoteId ?? null;
|
|
66644
66647
|
return React.useMemo(() => {
|
|
66645
|
-
if (!runtime ||
|
|
66648
|
+
if (!runtime || isListLoading == null) {
|
|
66646
66649
|
return null;
|
|
66647
66650
|
}
|
|
66648
66651
|
return {
|
|
66649
66652
|
activeThreadId,
|
|
66650
|
-
|
|
66651
|
-
|
|
66653
|
+
isListLoading,
|
|
66654
|
+
isThreadLoading,
|
|
66652
66655
|
switchToThread,
|
|
66653
66656
|
switchToNewThread
|
|
66654
66657
|
};
|
|
66655
|
-
}, [runtime, activeThreadId,
|
|
66658
|
+
}, [runtime, activeThreadId, isListLoading, isThreadLoading, switchToThread, switchToNewThread]);
|
|
66656
66659
|
}
|
|
66657
66660
|
function useAppendToComposer() {
|
|
66658
66661
|
const aui = useAui();
|