@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.js CHANGED
@@ -24300,7 +24300,7 @@ function useAthenaThreadListAdapter(config2) {
24300
24300
  );
24301
24301
  return useMemo(() => ({
24302
24302
  async list() {
24303
- if (!auth.token) {
24303
+ if (!auth.token && !auth.apiKey) {
24304
24304
  return { threads: [] };
24305
24305
  }
24306
24306
  try {
@@ -24642,6 +24642,16 @@ function AthenaWithThreadList({
24642
24642
  core.__internal_load();
24643
24643
  }
24644
24644
  }, [runtime]);
24645
+ const previousAuthRefreshKeyRef = useRef(null);
24646
+ const authRefreshKey = `${backendUrl}::${apiKey ?? ""}::${token ?? ""}`;
24647
+ useEffect(() => {
24648
+ const previousAuthRefreshKey = previousAuthRefreshKeyRef.current;
24649
+ previousAuthRefreshKeyRef.current = authRefreshKey;
24650
+ if (previousAuthRefreshKey === null || previousAuthRefreshKey === authRefreshKey) {
24651
+ return;
24652
+ }
24653
+ handleRefresh();
24654
+ }, [authRefreshKey, handleRefresh]);
24645
24655
  const auiTools = useMemo(() => Tools({ toolkit: frontendTools }), [frontendTools]);
24646
24656
  const aui = useAui({ tools: auiTools });
24647
24657
  const athenaConfig = useMemo(