@vgroup/dialbox 0.0.43 → 0.0.45

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.
@@ -2199,7 +2199,7 @@ class DialboxComponent {
2199
2199
  this.selectedCallerId = { number: contact.from };
2200
2200
  this.isSmartDialCall = true;
2201
2201
  setTimeout(() => {
2202
- this.isDialpadHidden = false;
2202
+ this.isDialpadHidden = true;
2203
2203
  }, 2000);
2204
2204
  this.callData.phone = contact.number;
2205
2205
  this.callData.name = contact.name;
@@ -2213,7 +2213,7 @@ class DialboxComponent {
2213
2213
  else {
2214
2214
  this.getUserCallSetting();
2215
2215
  setTimeout(() => {
2216
- this.isDialpadHidden = false;
2216
+ this.isDialpadHidden = true;
2217
2217
  }, 1000);
2218
2218
  this.getUserInformation(contact);
2219
2219
  // this.incomingCallsList.push(contact)
@@ -2260,7 +2260,7 @@ class DialboxComponent {
2260
2260
  }
2261
2261
  else {
2262
2262
  this.isCallInProgress = true;
2263
- this.isDialpadHidden = false;
2263
+ this.isDialpadHidden = true;
2264
2264
  this.callData.phone = incomingCallData.parameters['From'];
2265
2265
  this.getUserInformation(incomingCallData);
2266
2266
  this.callData.name = incomingCallData.customParameters.get('name');
@@ -2385,7 +2385,7 @@ class DialboxComponent {
2385
2385
  }
2386
2386
  }
2387
2387
  hideDialpad() {
2388
- this.isDialpadHidden = true;
2388
+ this.isDialpadHidden = false;
2389
2389
  this.closeDialpadEvent.emit();
2390
2390
  this.clearAllDialed();
2391
2391
  this.filteredContactList = [];
@@ -3026,9 +3026,40 @@ class DialboxComponent {
3026
3026
  this.newIncomingCallData = call;
3027
3027
  }
3028
3028
  rejectNewIncomingCall(call) {
3029
- call.reject();
3030
- this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters.CallSid !== call.parameters['CallSid']);
3031
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters.CallSid !== call.parameters['CallSid']);
3029
+ try {
3030
+ if (!call || typeof call.reject !== 'function') {
3031
+ console.error('Invalid call object provided or missing reject method');
3032
+ return;
3033
+ }
3034
+ // Reject the call
3035
+ call.reject();
3036
+ // Get call SID safely
3037
+ const callSid = call.parameters?.CallSid || call.parameters?.callSid;
3038
+ if (!callSid) {
3039
+ console.warn('No CallSid found for rejected call');
3040
+ return;
3041
+ }
3042
+ // Filter out the rejected call from the lists
3043
+ const filterByCallSid = (item) => {
3044
+ const itemSid = item.parameters?.CallSid || item.parameters?.callSid;
3045
+ return itemSid !== callSid;
3046
+ };
3047
+ // Update call lists
3048
+ if (Array.isArray(this.newIncomingCalls)) {
3049
+ this.newIncomingCalls = this.newIncomingCalls.filter(filterByCallSid);
3050
+ }
3051
+ if (Array.isArray(this.incomingCallsList)) {
3052
+ this.incomingCallsList = this.incomingCallsList.filter(filterByCallSid);
3053
+ }
3054
+ // Reset call state if no more incoming calls
3055
+ if (!this.incomingCallsList || this.incomingCallsList.length === 0) {
3056
+ this.isCallInProgress = false;
3057
+ this.isDialpadHidden = false;
3058
+ }
3059
+ }
3060
+ catch (error) {
3061
+ console.error('Error rejecting incoming call:', error);
3062
+ }
3032
3063
  }
3033
3064
  newIncomingCallInitiated() {
3034
3065
  this.isCallInProgress = true;