@vgroup/dialbox 0.1.122 → 0.1.123

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.
@@ -2388,8 +2388,20 @@ class CallProgressComponent {
2388
2388
  this.callData.phone = incomingCall.parameters['From'];
2389
2389
  this.callData.name = incomingCall.customParameters?.get('name') || '-';
2390
2390
  this.callData.img = incomingCall.customParameters?.get('image') || 'assets/images/user.jpg';
2391
- this.isConcurrentIncoming = false;
2392
- this.incomingCallDiv = false;
2391
+ // Remove accepted call from the list
2392
+ this.newIncomingCallsList = (this.newIncomingCallsList || []).filter((c) => c?.parameters?.CallSid !== incomingCall?.parameters?.CallSid);
2393
+ this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2394
+ // Check if more calls are waiting
2395
+ if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
2396
+ // Keep showing concurrent banner for remaining calls
2397
+ this.isConcurrentIncoming = true;
2398
+ this.incomingCallDiv = true;
2399
+ }
2400
+ else {
2401
+ // No more calls waiting - hide banner
2402
+ this.isConcurrentIncoming = false;
2403
+ this.incomingCallDiv = false;
2404
+ }
2393
2405
  this.disbaleEndCallBtn = false;
2394
2406
  // Reset timer for new call
2395
2407
  this.stopTimer();
@@ -2490,15 +2502,22 @@ class CallProgressComponent {
2490
2502
  }
2491
2503
  }
2492
2504
  closeIncomingCall(data) {
2493
- // this.incomingCallDiv = false;
2494
2505
  if (data.show) {
2495
- //this.showCallProgressEvent.emit()
2496
- // handle incoming call accepted
2506
+ // Handle incoming call accepted
2497
2507
  this.startTimer();
2498
2508
  this.disbaleEndCallBtn = false;
2499
2509
  this.call = data.call;
2500
- this.isConcurrentIncoming = false;
2501
- this.incomingCallDiv = false;
2510
+ // Check if there are more incoming calls waiting
2511
+ if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
2512
+ // There are more calls waiting - show concurrent incoming banner
2513
+ this.isConcurrentIncoming = true;
2514
+ this.incomingCallDiv = true;
2515
+ }
2516
+ else {
2517
+ // No more calls waiting - hide incoming UI
2518
+ this.isConcurrentIncoming = false;
2519
+ this.incomingCallDiv = false;
2520
+ }
2502
2521
  const incomingDetail = this.extensionService.getCallSid();
2503
2522
  this.incomingRecordCall = incomingDetail.recordCall;
2504
2523
  if (this.incomingRecordCall) {
@@ -2510,13 +2529,30 @@ class CallProgressComponent {
2510
2529
  this.cdr.detectChanges();
2511
2530
  }
2512
2531
  else {
2513
- // incoming call rejected or auto-cancelled
2514
- this.isConcurrentIncoming = false;
2515
- this.incomingCallDiv = false;
2516
- // If there is NO active call, then propagate end. Otherwise keep ongoing UI.
2517
- if (!this.call || this.call.status() !== 'open') {
2518
- console.log('test7');
2519
- this.endCallEvent.emit();
2532
+ // Incoming call rejected or auto-cancelled
2533
+ // Check if there are more incoming calls waiting
2534
+ if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
2535
+ // There are more calls waiting - keep showing incoming UI
2536
+ if (this.call && this.call.status() === 'open') {
2537
+ // Active call exists - show concurrent banner
2538
+ this.isConcurrentIncoming = true;
2539
+ this.incomingCallDiv = true;
2540
+ }
2541
+ else {
2542
+ // No active call - show full incoming UI
2543
+ this.isConcurrentIncoming = false;
2544
+ this.incomingCallDiv = true;
2545
+ }
2546
+ }
2547
+ else {
2548
+ // No more calls waiting - hide incoming UI
2549
+ this.isConcurrentIncoming = false;
2550
+ this.incomingCallDiv = false;
2551
+ // If there is NO active call, then propagate end. Otherwise keep ongoing UI.
2552
+ if (!this.call || this.call.status() !== 'open') {
2553
+ console.log('test7');
2554
+ this.endCallEvent.emit();
2555
+ }
2520
2556
  }
2521
2557
  }
2522
2558
  }
@@ -2662,6 +2698,26 @@ class CallProgressComponent {
2662
2698
  incomingCallsNewList(data) {
2663
2699
  this.newIncomingCallsList = data;
2664
2700
  this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2701
+ // Update UI visibility based on the updated list
2702
+ if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
2703
+ // There are calls in the queue
2704
+ if (this.call && this.call.status() === 'open') {
2705
+ // Active call exists - show concurrent banner
2706
+ this.isConcurrentIncoming = true;
2707
+ this.incomingCallDiv = true;
2708
+ }
2709
+ else {
2710
+ // No active call - show full incoming UI
2711
+ this.isConcurrentIncoming = false;
2712
+ this.incomingCallDiv = true;
2713
+ }
2714
+ }
2715
+ else {
2716
+ // No calls in queue - hide incoming UI
2717
+ this.isConcurrentIncoming = false;
2718
+ this.incomingCallDiv = false;
2719
+ }
2720
+ this.cdr.detectChanges();
2665
2721
  }
2666
2722
  selectedIncomingCallInfo(data) {
2667
2723
  this.selectedIncomingCall = data;