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