@poolse/react 2.15.0 → 2.15.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.
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to `@poolse/react` are documented here. Format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
5
|
[semver](https://semver.org).
|
|
6
6
|
|
|
7
|
+
## [2.15.1] — 2026-08-23
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **A video call opened with the camera off for whoever answered it.**
|
|
12
|
+
`media` was derived from `incoming ?? outgoing`, and `accept()` clears
|
|
13
|
+
`incoming` in the same batch that flips the phase — so the callee fell
|
|
14
|
+
back to `'audio'` and its room never opened the camera, while the
|
|
15
|
+
caller (which keeps `outgoing`) did. The default looked random; it was
|
|
16
|
+
really "whichever end of the call you were on". The media type of the
|
|
17
|
+
call in progress is now tracked in its own right.
|
|
18
|
+
|
|
7
19
|
## [2.15.0] — 2026-08-23
|
|
8
20
|
|
|
9
21
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -1331,6 +1331,7 @@ function useCalls(userId, opts = {}) {
|
|
|
1331
1331
|
const [outgoing, setOutgoing] = react.useState(null);
|
|
1332
1332
|
const [activeConversationId, setActiveConversationId] = react.useState(null);
|
|
1333
1333
|
const [activeCallId, setActiveCallId] = react.useState(null);
|
|
1334
|
+
const [activeMedia, setActiveMedia] = react.useState(null);
|
|
1334
1335
|
const [error, setError] = react.useState(null);
|
|
1335
1336
|
const incomingRef = react.useRef(null);
|
|
1336
1337
|
incomingRef.current = incoming;
|
|
@@ -1370,12 +1371,14 @@ function useCalls(userId, opts = {}) {
|
|
|
1370
1371
|
setPhase("declined");
|
|
1371
1372
|
setOutgoing(null);
|
|
1372
1373
|
setActiveCallId(null);
|
|
1374
|
+
setActiveMedia(null);
|
|
1373
1375
|
});
|
|
1374
1376
|
const offBusy = calls.onBusy((call2) => {
|
|
1375
1377
|
if (!isCurrent(call2.callId)) return;
|
|
1376
1378
|
setPhase("busy");
|
|
1377
1379
|
setOutgoing(null);
|
|
1378
1380
|
setActiveCallId(null);
|
|
1381
|
+
setActiveMedia(null);
|
|
1379
1382
|
});
|
|
1380
1383
|
const offEnded = calls.onEnded((call2) => {
|
|
1381
1384
|
if (!isCurrent(call2.callId)) return;
|
|
@@ -1384,12 +1387,14 @@ function useCalls(userId, opts = {}) {
|
|
|
1384
1387
|
setOutgoing(null);
|
|
1385
1388
|
setActiveConversationId(null);
|
|
1386
1389
|
setActiveCallId(null);
|
|
1390
|
+
setActiveMedia(null);
|
|
1387
1391
|
});
|
|
1388
1392
|
const offCancelled = calls.onCancelled((call2) => {
|
|
1389
1393
|
if (call2.callId !== incomingRef.current?.callId) return;
|
|
1390
1394
|
setIncoming(null);
|
|
1391
1395
|
setPhase("idle");
|
|
1392
1396
|
setActiveCallId(null);
|
|
1397
|
+
setActiveMedia(null);
|
|
1393
1398
|
});
|
|
1394
1399
|
return () => {
|
|
1395
1400
|
offIncoming();
|
|
@@ -1408,6 +1413,7 @@ function useCalls(userId, opts = {}) {
|
|
|
1408
1413
|
const placed = await calls.invite(conversationId, media2);
|
|
1409
1414
|
setOutgoing(placed);
|
|
1410
1415
|
setActiveCallId(placed.callId);
|
|
1416
|
+
setActiveMedia(placed.media);
|
|
1411
1417
|
setPhase("ringing-out");
|
|
1412
1418
|
} catch (err) {
|
|
1413
1419
|
setError(err instanceof Error ? err : new Error(String(err)));
|
|
@@ -1424,6 +1430,7 @@ function useCalls(userId, opts = {}) {
|
|
|
1424
1430
|
await calls.accept(target);
|
|
1425
1431
|
setActiveConversationId(target.conversationId);
|
|
1426
1432
|
setActiveCallId(target.callId);
|
|
1433
|
+
setActiveMedia(target.media);
|
|
1427
1434
|
setPhase("active");
|
|
1428
1435
|
setIncoming(null);
|
|
1429
1436
|
} catch (err) {
|
|
@@ -1443,6 +1450,7 @@ function useCalls(userId, opts = {}) {
|
|
|
1443
1450
|
} finally {
|
|
1444
1451
|
setIncoming(null);
|
|
1445
1452
|
setActiveCallId(null);
|
|
1453
|
+
setActiveMedia(null);
|
|
1446
1454
|
setPhase("idle");
|
|
1447
1455
|
}
|
|
1448
1456
|
},
|
|
@@ -1457,6 +1465,7 @@ function useCalls(userId, opts = {}) {
|
|
|
1457
1465
|
} finally {
|
|
1458
1466
|
setOutgoing(null);
|
|
1459
1467
|
setActiveCallId(null);
|
|
1468
|
+
setActiveMedia(null);
|
|
1460
1469
|
setPhase("idle");
|
|
1461
1470
|
}
|
|
1462
1471
|
}, [calls, outgoing]);
|
|
@@ -1492,6 +1501,7 @@ function useCalls(userId, opts = {}) {
|
|
|
1492
1501
|
setOutgoing(null);
|
|
1493
1502
|
setActiveConversationId(null);
|
|
1494
1503
|
setActiveCallId(null);
|
|
1504
|
+
setActiveMedia(null);
|
|
1495
1505
|
}
|
|
1496
1506
|
}, [calls, phase, incoming, outgoing, activeConversationId, activeCallId]);
|
|
1497
1507
|
const reset = react.useCallback(() => {
|
|
@@ -1500,9 +1510,10 @@ function useCalls(userId, opts = {}) {
|
|
|
1500
1510
|
setOutgoing(null);
|
|
1501
1511
|
setActiveConversationId(null);
|
|
1502
1512
|
setActiveCallId(null);
|
|
1513
|
+
setActiveMedia(null);
|
|
1503
1514
|
setError(null);
|
|
1504
1515
|
}, []);
|
|
1505
|
-
const media = incoming?.media ?? outgoing?.media ?? "audio";
|
|
1516
|
+
const media = incoming?.media ?? outgoing?.media ?? activeMedia ?? "audio";
|
|
1506
1517
|
return {
|
|
1507
1518
|
phase,
|
|
1508
1519
|
incoming,
|