@voicemaster/react 1.0.0 → 1.0.2

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
@@ -79,7 +79,9 @@ function useVoice(options) {
79
79
  });
80
80
  clientRef.current = client;
81
81
  if (options.autoConnect !== false) {
82
- client.connect();
82
+ setTimeout(() => {
83
+ client.connect();
84
+ }, 100);
83
85
  }
84
86
  return () => {
85
87
  client.disconnect();
package/dist/index.mjs CHANGED
@@ -53,7 +53,9 @@ function useVoice(options) {
53
53
  });
54
54
  clientRef.current = client;
55
55
  if (options.autoConnect !== false) {
56
- client.connect();
56
+ setTimeout(() => {
57
+ client.connect();
58
+ }, 100);
57
59
  }
58
60
  return () => {
59
61
  client.disconnect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicemaster/react",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "React hooks for VoiceMaster voice communication",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/src/useVoice.ts CHANGED
@@ -69,7 +69,10 @@ export function useVoice(options: UseVoiceOptions) {
69
69
  clientRef.current = client;
70
70
 
71
71
  if (options.autoConnect !== false) {
72
- client.connect();
72
+ // Добавляем задержку, чтобы клиент успел инициализироваться
73
+ setTimeout(() => {
74
+ client.connect();
75
+ }, 100);
73
76
  }
74
77
 
75
78
  return () => {