@trtc/calls-uikit-react 4.2.3 → 4.2.4
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/package.json +3 -3
- package/src/TUICallService/CallService/engineEventHandler.ts +1 -1
- package/src/TUICallService/CallService/index.ts +19 -3
- package/src/TUICallService/utils/validate/avoidRepeatedCall.ts +5 -0
- package/src/index.ts +1 -1
- package/tuicall-uikit-react.es.js +20 -4
- package/tuicall-uikit-react.umd.js +2 -2
- package/types/TUICallService/CallService/index.d.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trtc/calls-uikit-react",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"main": "./tuicall-uikit-react.umd.js",
|
|
5
5
|
"module": "./tuicall-uikit-react.es.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@tencentcloud/tui-core-lite": "1.0.0",
|
|
17
|
-
"@trtc/call-engine-lite-js": "~3.4.
|
|
17
|
+
"@trtc/call-engine-lite-js": "~3.4.7",
|
|
18
18
|
"@tencentcloud/lite-chat": "^1.5.0",
|
|
19
|
-
"@trtc/call-engine-lite-wx": "~3.4.
|
|
19
|
+
"@trtc/call-engine-lite-wx": "~3.4.7"
|
|
20
20
|
},
|
|
21
21
|
"bugs": {
|
|
22
22
|
"url": "https://github.com/tencentyun/TUICallKit/issues"
|
|
@@ -226,6 +226,7 @@ export default class EngineEventHandler {
|
|
|
226
226
|
this._unNormalEventsManager(event, TUICallEvent.LINE_BUSY);
|
|
227
227
|
}
|
|
228
228
|
private _handleCallNotConnected(event: any): void {
|
|
229
|
+
this?._callService?._cleanupAvoidRepeatCallState?.();
|
|
229
230
|
this._callService?.executeExternalAfterCalling();
|
|
230
231
|
this._unNormalEventsManager(event, TUICallEvent.ON_CALL_NOT_CONNECTED);
|
|
231
232
|
}
|
|
@@ -239,7 +240,6 @@ export default class EngineEventHandler {
|
|
|
239
240
|
}
|
|
240
241
|
private _handleCallingEnd(event: any): void {
|
|
241
242
|
console.log(`${NAME.PREFIX}callEnd event data: ${JSON.stringify(event)}.`);
|
|
242
|
-
|
|
243
243
|
this._callService?.executeExternalAfterCalling();
|
|
244
244
|
this._callService?._resetCallStore();
|
|
245
245
|
}
|
|
@@ -26,7 +26,7 @@ const TUIGlobal: ITUIGlobal = TuiGlobal.getInstance();
|
|
|
26
26
|
const TUIStore: ITUIStore = TuiStore.getInstance();
|
|
27
27
|
const uiDesign = UIDesign.getInstance();
|
|
28
28
|
uiDesign.setTUIStore(TUIStore);
|
|
29
|
-
const version = '4.2.
|
|
29
|
+
const version = '4.2.4';
|
|
30
30
|
const frameWork = 'react';
|
|
31
31
|
export { TUIGlobal, TUIStore, uiDesign };
|
|
32
32
|
|
|
@@ -67,7 +67,7 @@ export default class TUICallService {
|
|
|
67
67
|
}
|
|
68
68
|
return TUICallService.instance;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
private _loadWasm() {
|
|
71
71
|
TUICallEngine.once('ready', () => this._wasmReadyResolve());
|
|
72
72
|
}
|
|
73
73
|
@avoidRepeatedCall()
|
|
@@ -83,7 +83,7 @@ export default class TUICallService {
|
|
|
83
83
|
this._isInitialized = true;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
private async _doInit(params: IInitParams) {
|
|
87
87
|
try {
|
|
88
88
|
if (this._tuiCallEngine) return;
|
|
89
89
|
// @ts-ignore
|
|
@@ -674,7 +674,23 @@ export default class TUICallService {
|
|
|
674
674
|
this._timerId = -1;
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
+
// clear all use avoidRepeatCall decorator state
|
|
678
|
+
private _cleanupAllAvoidRepeatCallState() {
|
|
679
|
+
this._tuiCallEngine?.reportLog?.({ name: 'TUICallkit._cleanupAllAvoidRepeatCallState', data: { } });
|
|
680
|
+
const methodsToClean = [
|
|
681
|
+
(this as any).calls,
|
|
682
|
+
(this as any).accept,
|
|
683
|
+
(this as any).hangup,
|
|
684
|
+
(this as any).reject,
|
|
685
|
+
];
|
|
686
|
+
|
|
687
|
+
methodsToClean.forEach(method => {
|
|
688
|
+
method?.clearCallState?.(this);
|
|
689
|
+
});
|
|
690
|
+
}
|
|
677
691
|
private _resetCallStore() {
|
|
692
|
+
this._cleanupAllAvoidRepeatCallState();
|
|
693
|
+
|
|
678
694
|
const oldStatusStr = generateStatusChangeText();
|
|
679
695
|
this._stopTimer();
|
|
680
696
|
// localUserInfo, language 在通话结束后不需要清除
|
package/src/index.ts
CHANGED
|
@@ -755,6 +755,8 @@ function Ne() {
|
|
|
755
755
|
} catch (s) {
|
|
756
756
|
throw i.delete(this), s;
|
|
757
757
|
}
|
|
758
|
+
}, n.value.clearCallState = function(r) {
|
|
759
|
+
i.delete(r);
|
|
758
760
|
}, n;
|
|
759
761
|
};
|
|
760
762
|
}
|
|
@@ -1716,8 +1718,8 @@ const wr = (Nt = class {
|
|
|
1716
1718
|
this._unNormalEventsManager(e, v.LINE_BUSY);
|
|
1717
1719
|
}
|
|
1718
1720
|
_handleCallNotConnected(e) {
|
|
1719
|
-
var n;
|
|
1720
|
-
(n = this._callService) == null || n.executeExternalAfterCalling(), this._unNormalEventsManager(e, v.ON_CALL_NOT_CONNECTED);
|
|
1721
|
+
var n, a, i;
|
|
1722
|
+
(a = (n = this == null ? void 0 : this._callService) == null ? void 0 : n._cleanupAvoidRepeatCallState) == null || a.call(n), (i = this._callService) == null || i.executeExternalAfterCalling(), this._unNormalEventsManager(e, v.ON_CALL_NOT_CONNECTED);
|
|
1721
1723
|
}
|
|
1722
1724
|
async _handleOnUserInviting(e) {
|
|
1723
1725
|
const { userID: n } = Be(e);
|
|
@@ -1850,7 +1852,7 @@ var Qs = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, ge = (t, e
|
|
|
1850
1852
|
};
|
|
1851
1853
|
const z = yr.getInstance(), j = ua.getInstance(), mt = oa.getInstance();
|
|
1852
1854
|
mt.setTUIStore(j);
|
|
1853
|
-
const xi = "4.2.
|
|
1855
|
+
const xi = "4.2.4", vi = "react";
|
|
1854
1856
|
var gt;
|
|
1855
1857
|
const Ae = (gt = class {
|
|
1856
1858
|
constructor() {
|
|
@@ -2357,7 +2359,21 @@ const Ae = (gt = class {
|
|
|
2357
2359
|
_stopTimer() {
|
|
2358
2360
|
this._timerId !== -1 && (ra.clearTask(this._timerId), this._timerId = -1);
|
|
2359
2361
|
}
|
|
2362
|
+
// clear all use avoidRepeatCall decorator state
|
|
2363
|
+
_cleanupAllAvoidRepeatCallState() {
|
|
2364
|
+
var n, a;
|
|
2365
|
+
(a = (n = this._tuiCallEngine) == null ? void 0 : n.reportLog) == null || a.call(n, { name: "TUICallkit._cleanupAllAvoidRepeatCallState", data: {} }), [
|
|
2366
|
+
this.calls,
|
|
2367
|
+
this.accept,
|
|
2368
|
+
this.hangup,
|
|
2369
|
+
this.reject
|
|
2370
|
+
].forEach((i) => {
|
|
2371
|
+
var r;
|
|
2372
|
+
(r = i == null ? void 0 : i.clearCallState) == null || r.call(i, this);
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2360
2375
|
_resetCallStore() {
|
|
2376
|
+
this._cleanupAllAvoidRepeatCallState();
|
|
2361
2377
|
const e = Wn();
|
|
2362
2378
|
this._stopTimer();
|
|
2363
2379
|
let n = Object.keys(Xn).filter((r) => {
|
|
@@ -8158,7 +8174,7 @@ ga.install = qd;
|
|
|
8158
8174
|
const sN = {
|
|
8159
8175
|
AUDIO_CALL: 1,
|
|
8160
8176
|
VIDEO_CALL: 2
|
|
8161
|
-
}, lN = "4.2.
|
|
8177
|
+
}, lN = "4.2.4";
|
|
8162
8178
|
export {
|
|
8163
8179
|
$ as CallMediaType,
|
|
8164
8180
|
oN as CallMessage,
|