@poolse/react 2.4.1 → 2.6.0
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.cjs +30 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +30 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1177,28 +1177,36 @@ function useCalls(userId, opts = {}) {
|
|
|
1177
1177
|
},
|
|
1178
1178
|
[calls]
|
|
1179
1179
|
);
|
|
1180
|
-
const accept = react.useCallback(
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1180
|
+
const accept = react.useCallback(
|
|
1181
|
+
async (call2) => {
|
|
1182
|
+
const target = call2 ?? incoming;
|
|
1183
|
+
if (!calls || !target) return;
|
|
1184
|
+
try {
|
|
1185
|
+
await calls.accept(target);
|
|
1186
|
+
setActiveConversationId(target.conversationId);
|
|
1187
|
+
setPhase("active");
|
|
1188
|
+
setIncoming(null);
|
|
1189
|
+
} catch (err) {
|
|
1190
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
1191
|
+
}
|
|
1192
|
+
},
|
|
1193
|
+
[calls, incoming]
|
|
1194
|
+
);
|
|
1195
|
+
const decline = react.useCallback(
|
|
1196
|
+
async (call2) => {
|
|
1197
|
+
const target = call2 ?? incoming;
|
|
1198
|
+
if (!calls || !target) return;
|
|
1199
|
+
try {
|
|
1200
|
+
await calls.decline(target);
|
|
1201
|
+
} catch (err) {
|
|
1202
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
1203
|
+
} finally {
|
|
1204
|
+
setIncoming(null);
|
|
1205
|
+
setPhase("idle");
|
|
1206
|
+
}
|
|
1207
|
+
},
|
|
1208
|
+
[calls, incoming]
|
|
1209
|
+
);
|
|
1202
1210
|
const cancel = react.useCallback(async () => {
|
|
1203
1211
|
if (!calls || !outgoing) return;
|
|
1204
1212
|
try {
|