@vgroup/dialbox 0.0.98 → 0.0.99

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.
@@ -2233,29 +2233,30 @@ class DialboxComponent {
2233
2233
  this.isMinimised = false;
2234
2234
  // Initialize if dialpad is visible by default
2235
2235
  if (!this.isDialpadHidden) {
2236
+ console.log('sfsdfdsf');
2236
2237
  this.initializeTwilio();
2237
2238
  }
2238
2239
  }
2239
2240
  initializeTwilio() {
2240
- if (this.isInitialized)
2241
- return;
2242
- this.token = localStorage.getItem('ext_token') || '';
2243
- if (!this.token) {
2244
- console.error('No authentication token found');
2245
- return;
2246
- }
2247
- this.isInitialized = true;
2248
- // Initialize Twilio service
2249
- this.twilioService.initializeTwilioDevice();
2250
- // Subscribe to incoming calls to show dialpad when call comes in
2251
- const callSub = this.twilioService.currentCall.subscribe(call => {
2252
- if (call) {
2253
- console.log('Incoming call received:', call);
2254
- this.isCallInProgress = true;
2255
- this.isDialpadHidden = false; // Show dialpad on incoming call
2241
+ if (!this.isInitialized) {
2242
+ this.token = localStorage.getItem('ext_token') || '';
2243
+ if (!this.token) {
2244
+ console.error('No authentication token found');
2245
+ return;
2256
2246
  }
2257
- });
2258
- this.subscriptions.add(callSub);
2247
+ this.isInitialized = true;
2248
+ // Initialize Twilio service
2249
+ this.twilioService.initializeTwilioDevice();
2250
+ // Subscribe to incoming calls to show dialpad when call comes in
2251
+ const callSub = this.twilioService.currentCall.subscribe(call => {
2252
+ if (call) {
2253
+ console.log('Incoming call received:', call);
2254
+ this.isCallInProgress = true;
2255
+ this.isDialpadHidden = false; // Show dialpad on incoming call
2256
+ }
2257
+ });
2258
+ this.subscriptions.add(callSub);
2259
+ }
2259
2260
  }
2260
2261
  // ngOnChange() {
2261
2262
  // this.initializeTwilio();
@@ -2513,16 +2514,12 @@ class DialboxComponent {
2513
2514
  this.callData.isIncomingCall = true;
2514
2515
  }
2515
2516
  this.incomingCallData.on('cancel', () => {
2516
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
2517
- if (this.incomingCallsList.length == 0) {
2518
- this.isCallInProgress = false;
2519
- }
2517
+ this.incomingCallsList = [];
2518
+ this.isCallInProgress = false;
2520
2519
  });
2521
2520
  this.incomingCallData.on('disconnect', () => {
2522
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
2523
- if (this.incomingCallsList.length == 0) {
2524
- this.isCallInProgress = false;
2525
- }
2521
+ this.incomingCallsList = [];
2522
+ this.isCallInProgress = false;
2526
2523
  });
2527
2524
  }
2528
2525
  }