@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.
@@ -2249,29 +2249,30 @@ class DialboxComponent {
2249
2249
  this.isMinimised = false;
2250
2250
  // Initialize if dialpad is visible by default
2251
2251
  if (!this.isDialpadHidden) {
2252
+ console.log('sfsdfdsf');
2252
2253
  this.initializeTwilio();
2253
2254
  }
2254
2255
  }
2255
2256
  initializeTwilio() {
2256
- if (this.isInitialized)
2257
- return;
2258
- this.token = localStorage.getItem('ext_token') || '';
2259
- if (!this.token) {
2260
- console.error('No authentication token found');
2261
- return;
2262
- }
2263
- this.isInitialized = true;
2264
- // Initialize Twilio service
2265
- this.twilioService.initializeTwilioDevice();
2266
- // Subscribe to incoming calls to show dialpad when call comes in
2267
- const callSub = this.twilioService.currentCall.subscribe(call => {
2268
- if (call) {
2269
- console.log('Incoming call received:', call);
2270
- this.isCallInProgress = true;
2271
- this.isDialpadHidden = false; // Show dialpad on incoming call
2257
+ if (!this.isInitialized) {
2258
+ this.token = localStorage.getItem('ext_token') || '';
2259
+ if (!this.token) {
2260
+ console.error('No authentication token found');
2261
+ return;
2272
2262
  }
2273
- });
2274
- this.subscriptions.add(callSub);
2263
+ this.isInitialized = true;
2264
+ // Initialize Twilio service
2265
+ this.twilioService.initializeTwilioDevice();
2266
+ // Subscribe to incoming calls to show dialpad when call comes in
2267
+ const callSub = this.twilioService.currentCall.subscribe(call => {
2268
+ if (call) {
2269
+ console.log('Incoming call received:', call);
2270
+ this.isCallInProgress = true;
2271
+ this.isDialpadHidden = false; // Show dialpad on incoming call
2272
+ }
2273
+ });
2274
+ this.subscriptions.add(callSub);
2275
+ }
2275
2276
  }
2276
2277
  // ngOnChange() {
2277
2278
  // this.initializeTwilio();
@@ -2529,16 +2530,12 @@ class DialboxComponent {
2529
2530
  this.callData.isIncomingCall = true;
2530
2531
  }
2531
2532
  this.incomingCallData.on('cancel', () => {
2532
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
2533
- if (this.incomingCallsList.length == 0) {
2534
- this.isCallInProgress = false;
2535
- }
2533
+ this.incomingCallsList = [];
2534
+ this.isCallInProgress = false;
2536
2535
  });
2537
2536
  this.incomingCallData.on('disconnect', () => {
2538
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== this.incomingCallData.parameters['CallSid']);
2539
- if (this.incomingCallsList.length == 0) {
2540
- this.isCallInProgress = false;
2541
- }
2537
+ this.incomingCallsList = [];
2538
+ this.isCallInProgress = false;
2542
2539
  });
2543
2540
  }
2544
2541
  }