@trtc/calls-uikit-vue2 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trtc/calls-uikit-vue2",
3
- "version": "4.2.3",
3
+ "version": "4.2.4",
4
4
  "main": "./tuicall-uikit-vue2.umd.js",
5
5
  "module": "./tuicall-uikit-vue2.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.5",
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.5"
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.3';
29
+ const version = '4.2.4';
30
30
  const frameWork = 'vue2.7';
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
- public _loadWasm() {
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
- public async _doInit(params: IInitParams) {
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 在通话结束后不需要清除
@@ -34,6 +34,11 @@ export function avoidRepeatedCall() {
34
34
  throw error;
35
35
  }
36
36
  };
37
+
38
+ descriptor.value.clearCallState = function(instance: any) {
39
+ isCallingSet.delete(instance);
40
+ };
41
+
37
42
  return descriptor;
38
43
  };
39
44
  }
package/src/index.ts CHANGED
@@ -37,7 +37,7 @@ const TUICallType = {
37
37
  AUDIO_CALL: 1,
38
38
  VIDEO_CALL: 2,
39
39
  };
40
- const Version = '4.2.3'; // basic-demo 原来上报使用
40
+ const Version = '4.2.4'; // basic-demo 原来上报使用
41
41
 
42
42
  // 输出产物
43
43
  export {
@@ -700,6 +700,8 @@ function AA() {
700
700
  } catch (u) {
701
701
  throw n.delete(this), u;
702
702
  }
703
+ }, t.value.clearCallState = function(o) {
704
+ n.delete(o);
703
705
  }, t;
704
706
  };
705
707
  }
@@ -1719,8 +1721,8 @@ const b = LA.getInstance(), oo = GA.getInstance(), ae = class {
1719
1721
  this._unNormalEventsManager(a, m.LINE_BUSY);
1720
1722
  }
1721
1723
  _handleCallNotConnected(a) {
1722
- var A;
1723
- (A = this._callService) == null || A.executeExternalAfterCalling(), this._unNormalEventsManager(a, m.ON_CALL_NOT_CONNECTED);
1724
+ var A, t, e;
1725
+ (t = (A = this == null ? void 0 : this._callService) == null ? void 0 : A._cleanupAvoidRepeatCallState) == null || t.call(A), (e = this._callService) == null || e.executeExternalAfterCalling(), this._unNormalEventsManager(a, m.ON_CALL_NOT_CONNECTED);
1724
1726
  }
1725
1727
  async _handleOnUserInviting(a) {
1726
1728
  const { userID: A } = dA(a);
@@ -1852,7 +1854,7 @@ var so = Object.defineProperty, io = Object.getOwnPropertyDescriptor, eA = (a, A
1852
1854
  };
1853
1855
  const T = RA.getInstance(), d = LA.getInstance(), TA = GA.getInstance();
1854
1856
  TA.setTUIStore(d);
1855
- const xt = "4.2.3", Bt = "vue2.7", ne = class {
1857
+ const xt = "4.2.4", Bt = "vue2.7", ne = class {
1856
1858
  constructor() {
1857
1859
  this._tim = null, this._TUICore = null, this._timerId = -1, this._startTimeStamp = Ve(), this._bellContext = null, this._isFromChat = !1, this._currentGroupId = "", this._offlinePushInfo = null, this._permissionCheckTimer = null, this._chatCombine = null, this._engineEventHandler = null, this._isInitialized = !1, this._handleCallStatusChange = async (a) => {
1858
1860
  var A, t;
@@ -2317,7 +2319,20 @@ const xt = "4.2.3", Bt = "vue2.7", ne = class {
2317
2319
  _stopTimer() {
2318
2320
  this._timerId !== -1 && (ye.clearTask(this._timerId), this._timerId = -1);
2319
2321
  }
2322
+ _cleanupAllAvoidRepeatCallState() {
2323
+ var A, t;
2324
+ (t = (A = this._tuiCallEngine) == null ? void 0 : A.reportLog) == null || t.call(A, { name: "TUICallkit._cleanupAllAvoidRepeatCallState", data: {} }), [
2325
+ this.calls,
2326
+ this.accept,
2327
+ this.hangup,
2328
+ this.reject
2329
+ ].forEach((e) => {
2330
+ var n;
2331
+ (n = e == null ? void 0 : e.clearCallState) == null || n.call(e, this);
2332
+ });
2333
+ }
2320
2334
  _resetCallStore() {
2335
+ this._cleanupAllAvoidRepeatCallState();
2321
2336
  const a = Me();
2322
2337
  this._stopTimer();
2323
2338
  let A = Object.keys(Se).filter((n) => {
@@ -7592,7 +7607,7 @@ Oe.install = TI;
7592
7607
  const UI = {
7593
7608
  AUDIO_CALL: 1,
7594
7609
  VIDEO_CALL: 2
7595
- }, bI = "4.2.3";
7610
+ }, bI = "4.2.4";
7596
7611
  export {
7597
7612
  F as CallMediaType,
7598
7613
  K as CallRole,