@axiom-lattice/react-sdk 2.1.4 → 2.1.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
@@ -319,11 +319,14 @@ function useChat(threadId, options = {}) {
319
319
  pollInterval: options.resumeStreamPollInterval || 100
320
320
  },
321
321
  handleStreamEvent,
322
- () => {
322
+ async () => {
323
323
  setState((prev) => ({
324
324
  ...prev,
325
325
  isLoading: false
326
326
  }));
327
+ if (options.enableReturnStateWhenStreamCompleted) {
328
+ await fetchAndUpdateAgentState(threadId);
329
+ }
327
330
  stopStreamingRef.current = null;
328
331
  },
329
332
  (error) => {