@redocly/theme 0.68.0-next.9 → 0.68.1

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.
@@ -45,15 +45,16 @@ function getReplayConfiguration(_context) {
45
45
  }
46
46
  function useConfigureReplay(context, isOpened) {
47
47
  const [config, setConfig] = (0, react_1.useState)();
48
+ const contextRef = (0, react_1.useRef)(context);
49
+ contextRef.current = context;
48
50
  const refresh = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
49
51
  try {
50
- const result = yield getReplayConfiguration(context);
52
+ const result = yield getReplayConfiguration(contextRef.current);
51
53
  setConfig(result);
52
54
  }
53
55
  catch (error) {
54
- console.warn('Failed to configure replay for operation:', context.operation.operationId, error);
56
+ console.warn('Failed to configure replay for operation:', contextRef.current.operation.operationId, error);
55
57
  }
56
- // eslint-disable-next-line react-hooks/exhaustive-deps
57
58
  }), []);
58
59
  (0, react_1.useEffect)(() => {
59
60
  if (isOpened) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.68.0-next.9",
3
+ "version": "0.68.1",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -68,7 +68,7 @@
68
68
  "vitest": "4.1.10",
69
69
  "vitest-when": "0.6.2",
70
70
  "webpack": "5.105.2",
71
- "@redocly/realm-asyncapi-sdk": "0.14.0-next.4"
71
+ "@redocly/realm-asyncapi-sdk": "0.14.0"
72
72
  },
73
73
  "dependencies": {
74
74
  "@tanstack/react-query": "5.62.3",
@@ -1,4 +1,4 @@
1
- import { useEffect, useState, useCallback } from 'react';
1
+ import { useEffect, useState, useCallback, useRef } from 'react';
2
2
 
3
3
  import {
4
4
  type ConfigureRequestValues,
@@ -62,18 +62,20 @@ export function useConfigureReplay(context: ContextProps, isOpened: boolean) {
62
62
  ConfigureRequestValues | ConfigureServerRequestValues | null
63
63
  >();
64
64
 
65
+ const contextRef = useRef(context);
66
+ contextRef.current = context;
67
+
65
68
  const refresh = useCallback(async () => {
66
69
  try {
67
- const result = await getReplayConfiguration(context);
70
+ const result = await getReplayConfiguration(contextRef.current);
68
71
  setConfig(result);
69
72
  } catch (error) {
70
73
  console.warn(
71
74
  'Failed to configure replay for operation:',
72
- context.operation.operationId,
75
+ contextRef.current.operation.operationId,
73
76
  error,
74
77
  );
75
78
  }
76
- // eslint-disable-next-line react-hooks/exhaustive-deps
77
79
  }, []);
78
80
 
79
81
  useEffect(() => {