@athenaintel/react 0.9.4 → 0.9.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.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24318,7 +24318,7 @@ function useAthenaThreadListAdapter(config2) {
|
|
|
24318
24318
|
);
|
|
24319
24319
|
return React.useMemo(() => ({
|
|
24320
24320
|
async list() {
|
|
24321
|
-
if (!auth.token) {
|
|
24321
|
+
if (!auth.token && !auth.apiKey) {
|
|
24322
24322
|
return { threads: [] };
|
|
24323
24323
|
}
|
|
24324
24324
|
try {
|
|
@@ -24660,6 +24660,16 @@ function AthenaWithThreadList({
|
|
|
24660
24660
|
core.__internal_load();
|
|
24661
24661
|
}
|
|
24662
24662
|
}, [runtime]);
|
|
24663
|
+
const previousAuthRefreshKeyRef = React.useRef(null);
|
|
24664
|
+
const authRefreshKey = `${backendUrl}::${apiKey ?? ""}::${token ?? ""}`;
|
|
24665
|
+
React.useEffect(() => {
|
|
24666
|
+
const previousAuthRefreshKey = previousAuthRefreshKeyRef.current;
|
|
24667
|
+
previousAuthRefreshKeyRef.current = authRefreshKey;
|
|
24668
|
+
if (previousAuthRefreshKey === null || previousAuthRefreshKey === authRefreshKey) {
|
|
24669
|
+
return;
|
|
24670
|
+
}
|
|
24671
|
+
handleRefresh();
|
|
24672
|
+
}, [authRefreshKey, handleRefresh]);
|
|
24663
24673
|
const auiTools = React.useMemo(() => Tools({ toolkit: frontendTools }), [frontendTools]);
|
|
24664
24674
|
const aui = useAui({ tools: auiTools });
|
|
24665
24675
|
const athenaConfig = React.useMemo(
|