cat-qw-lib 1.0.12 → 1.0.13

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.
@@ -6281,7 +6281,7 @@ class QueueContainerComponent extends BaseContainerComponent {
6281
6281
  next: (res) => {
6282
6282
  this.queueList = Array.isArray(res) ? res : (res.data || res);
6283
6283
  this.baseStore.setQueueList(this.queueList);
6284
- this.restoreOrFilterQueues();
6284
+ this.filterQueues();
6285
6285
  this.loading = false;
6286
6286
  },
6287
6287
  error: (err) => {
@@ -6291,33 +6291,6 @@ class QueueContainerComponent extends BaseContainerComponent {
6291
6291
  }
6292
6292
  });
6293
6293
  }
6294
- /**
6295
- * Tries to restore the selected queue from sessionStorage. If not found or invalid, falls back to filterQueues (first queue).
6296
- */
6297
- restoreOrFilterQueues() {
6298
- const storedQueueStr = sessionStorage.getItem(SHARED.selectedQueue);
6299
- let restoredQueueId = null;
6300
- if (storedQueueStr) {
6301
- try {
6302
- const storedQueue = JSON.parse(storedQueueStr);
6303
- // Check if the stored queue exists in the current queue list
6304
- if (storedQueue && storedQueue._id) {
6305
- const found = this.queueList.find((q) => q._id === storedQueue._id);
6306
- if (found) {
6307
- restoredQueueId = found._id;
6308
- }
6309
- }
6310
- }
6311
- catch (e) { }
6312
- }
6313
- if (restoredQueueId) {
6314
- this.selectedQueueId = restoredQueueId;
6315
- this.handleQueueId(restoredQueueId);
6316
- }
6317
- else {
6318
- this.filterQueues();
6319
- }
6320
- }
6321
6294
  handleQueueId(queueId) {
6322
6295
  const newQueue = this.queueList.find((i) => i._id == queueId);
6323
6296
  if (newQueue) {
@@ -6339,12 +6312,9 @@ class QueueContainerComponent extends BaseContainerComponent {
6339
6312
  filterQueues() {
6340
6313
  this.filteredQueueData = this.queueBusinessService.filterQueuesByStatus(this.queueList, this.selectedStatus);
6341
6314
  if (this.filteredQueueData.length > 0) {
6342
- // Only select the first queue if not already set (restored)
6343
- if (!this.selectedQueueId || !this.filteredQueueData.some(q => q._id === this.selectedQueueId)) {
6344
- this.selectedQueueId = this.queueBusinessService.getFirstQueueId(this.filteredQueueData);
6345
- if (this.selectedQueueId) {
6346
- this.handleQueueId(this.selectedQueueId);
6347
- }
6315
+ this.selectedQueueId = this.queueBusinessService.getFirstQueueId(this.filteredQueueData);
6316
+ if (this.selectedQueueId) {
6317
+ this.handleQueueId(this.selectedQueueId);
6348
6318
  }
6349
6319
  }
6350
6320
  }
@@ -6426,7 +6396,7 @@ class QueueContainerComponent extends BaseContainerComponent {
6426
6396
  }
6427
6397
  onAssignmentComplete(event) {
6428
6398
  if (event.success) {
6429
- this.getQueueRecordsData();
6399
+ this.getAllQueueList();
6430
6400
  }
6431
6401
  this.assignmentComplete.emit(event);
6432
6402
  }