@voicemaster/react 1.0.2 → 1.0.3

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
@@ -49,6 +49,7 @@ function useVoice(options) {
49
49
  setIsConnected(false);
50
50
  setPeers([]);
51
51
  setRemoteStream(null);
52
+ setSpeakingUsers(/* @__PURE__ */ new Set());
52
53
  });
53
54
  client.on("remoteStream", (stream) => {
54
55
  setRemoteStream(stream);
@@ -79,9 +80,7 @@ function useVoice(options) {
79
80
  });
80
81
  clientRef.current = client;
81
82
  if (options.autoConnect !== false) {
82
- setTimeout(() => {
83
- client.connect();
84
- }, 100);
83
+ client.connect();
85
84
  }
86
85
  return () => {
87
86
  client.disconnect();
package/dist/index.mjs CHANGED
@@ -23,6 +23,7 @@ function useVoice(options) {
23
23
  setIsConnected(false);
24
24
  setPeers([]);
25
25
  setRemoteStream(null);
26
+ setSpeakingUsers(/* @__PURE__ */ new Set());
26
27
  });
27
28
  client.on("remoteStream", (stream) => {
28
29
  setRemoteStream(stream);
@@ -53,9 +54,7 @@ function useVoice(options) {
53
54
  });
54
55
  clientRef.current = client;
55
56
  if (options.autoConnect !== false) {
56
- setTimeout(() => {
57
- client.connect();
58
- }, 100);
57
+ client.connect();
59
58
  }
60
59
  return () => {
61
60
  client.disconnect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voicemaster/react",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
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
@@ -31,6 +31,7 @@ export function useVoice(options: UseVoiceOptions) {
31
31
  setIsConnected(false);
32
32
  setPeers([]);
33
33
  setRemoteStream(null);
34
+ setSpeakingUsers(new Set());
34
35
  });
35
36
 
36
37
  client.on('remoteStream', (stream) => {
@@ -69,10 +70,7 @@ export function useVoice(options: UseVoiceOptions) {
69
70
  clientRef.current = client;
70
71
 
71
72
  if (options.autoConnect !== false) {
72
- // Добавляем задержку, чтобы клиент успел инициализироваться
73
- setTimeout(() => {
74
- client.connect();
75
- }, 100);
73
+ client.connect();
76
74
  }
77
75
 
78
76
  return () => {
@@ -91,6 +89,7 @@ export function useVoice(options: UseVoiceOptions) {
91
89
  const toggleMute = useCallback(() => {
92
90
  if (clientRef.current) {
93
91
  clientRef.current.toggleMute();
92
+ // Добавляем обновление isMuted
94
93
  setIsMuted(prev => !prev);
95
94
  }
96
95
  }, []);