@vgroup/dialbox 0.5.33 → 0.5.35

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.
@@ -2106,13 +2106,14 @@ class CallProgressComponent {
2106
2106
  this.endIncomingCallEvent.emit(c);
2107
2107
  return false;
2108
2108
  }
2109
- let participantId = isAllCallEnd ? 'all' : c.participantId || c.participantId;
2109
+ let participantId = isAllCallEnd ? 'all' : c.participantId;
2110
2110
  let conferenceId = isAllCallEnd ? 'all' : c.conferenceId || this.currentCall.conferenceId;
2111
2111
  let res = yield this.getRemoveParticipants(participantId, conferenceId);
2112
2112
  if ((res === null || res === void 0 ? void 0 : res.status) == 201 && (res === null || res === void 0 ? void 0 : res.message) == 'participant already left') {
2113
2113
  this.cdr.detectChanges();
2114
2114
  }
2115
2115
  yield this.getAllParticipants(this.currentCall.conferenceSid);
2116
+ this.currentCallList = this.currentCallList.filter((res) => res.participantId !== c.participantId);
2116
2117
  this.incomeingCallSocketService.pause();
2117
2118
  this.endIncomingCallEvent.emit(c);
2118
2119
  this.cdr.detectChanges();
@@ -2476,6 +2477,7 @@ class CallProgressComponent {
2476
2477
  else {
2477
2478
  let index = this.currentCallList.findIndex((res) => res.participantId == data.participantId);
2478
2479
  this.currentCallList.splice(index, 1);
2480
+ swal("Error", res === null || res === void 0 ? void 0 : res.message, "error");
2479
2481
  this.incomeingCallSocketService.pause();
2480
2482
  this.endCallEvent.emit(data);
2481
2483
  }
@@ -3551,18 +3553,22 @@ class DialboxComponent {
3551
3553
  // console.log("WS Event Received:", incomingCallData.data);
3552
3554
  this.twilioService.conferenceCallInfo = incomingCallData;
3553
3555
  if (!!(incomingCallData === null || incomingCallData === void 0 ? void 0 : incomingCallData.length)) {
3556
+ incomingCallData = incomingCallData.filter((item) => { var _a; return ((_a = item.participants) === null || _a === void 0 ? void 0 : _a.length) > 0; });
3554
3557
  // this.incomingCallsList = incomingCallData.participants.filter((item: any) => !item.isLeft) || [];
3555
3558
  this.incomingCallsList = incomingCallData || [];
3556
3559
  let parentCall = [];
3557
- this.notificationCallList.forEach((call) => {
3558
- incomingCallData.forEach((item) => {
3559
- let info = item.participants.find((resInfo) => (resInfo === null || resInfo === void 0 ? void 0 : resInfo.id) === (call === null || call === void 0 ? void 0 : call.participantId));
3560
- // return info?.id
3561
- if (info) {
3562
- parentCall.push(info.id);
3563
- }
3560
+ if (this.notificationCallList.length) {
3561
+ this.notificationCallList.filter((res) => res.endTime >= (Date.now()));
3562
+ this.notificationCallList.forEach((call) => {
3563
+ incomingCallData.forEach((item) => {
3564
+ let info = item.participants.find((resInfo) => (resInfo === null || resInfo === void 0 ? void 0 : resInfo.id) === (call === null || call === void 0 ? void 0 : call.participantId));
3565
+ // return info?.id
3566
+ if (info) {
3567
+ parentCall.push(info.id);
3568
+ }
3569
+ });
3564
3570
  });
3565
- });
3571
+ }
3566
3572
  if ((parentCall === null || parentCall === void 0 ? void 0 : parentCall.length) > 0) {
3567
3573
  this.notificationCallList = this.notificationCallList.filter((item) => !parentCall.includes(item === null || item === void 0 ? void 0 : item.participantId));
3568
3574
  this.incomingCallsList = [...this.incomingCallsList, ...this.notificationCallList];
@@ -3984,7 +3990,10 @@ class DialboxComponent {
3984
3990
  incomingCall.participants[0]['sourceName'] = callerInfo.sourceName;
3985
3991
  incomingCall.participants[0]['subject'] = callerInfo.subject;
3986
3992
  }
3993
+ const now = Date.now();
3994
+ incomingCall['endTime'] = (Date.now() + 45 * 1000);
3987
3995
  this.notificationCallList.push(incomingCall);
3996
+ this.notificationCallList.filter((res) => (res === null || res === void 0 ? void 0 : res.endTime) >= now);
3988
3997
  this.incomingCallsList = [...this.incomingCallsList, ...this.notificationCallList];
3989
3998
  this.cdk.detectChanges();
3990
3999
  if ((_j = this.incomingCallnotification.data.data) === null || _j === void 0 ? void 0 : _j.participantId) {