cloud-ide-element 1.0.111 → 1.0.112

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.
@@ -3725,21 +3725,28 @@ class CideEleFileInputComponent {
3725
3725
  const notificationId = this.notificationService.showProgress('🔄 Preparing multiple file upload...', 0, { duration: 0 });
3726
3726
  this.uploadNotificationId.set(notificationId);
3727
3727
  // STEP 1: Generate or get group ID BEFORE starting any file uploads
3728
- const existingGroupId = this.uploadDataSignal().groupId;
3729
- if (existingGroupId) {
3730
- console.log('🆔 [FileInput] STEP 1 COMPLETE: Using existing group ID:', existingGroupId);
3731
- console.log('🔄 [FileInput] STEP 2: Starting file uploads with group ID:', existingGroupId);
3732
- this.groupId.set(existingGroupId);
3733
- this.startMulti(files, existingGroupId);
3728
+ // Check if component already has a group ID or if one is provided in uploadData
3729
+ const existingComponentGroupId = this.groupId();
3730
+ const existingUploadDataGroupId = this.uploadDataSignal().groupId;
3731
+ if (existingComponentGroupId) {
3732
+ // Component already has its own group ID - use it
3733
+ console.log('🆔 [FileInput] Using existing component group ID:', existingComponentGroupId);
3734
+ this.startMulti(files, existingComponentGroupId);
3735
+ }
3736
+ else if (existingUploadDataGroupId) {
3737
+ // Use group ID from uploadData and set it as component's group ID
3738
+ console.log('🆔 [FileInput] Using group ID from uploadData:', existingUploadDataGroupId);
3739
+ this.groupId.set(existingUploadDataGroupId);
3740
+ this.startMulti(files, existingUploadDataGroupId);
3734
3741
  }
3735
3742
  else {
3736
- console.log('🆔 [FileInput] No existing group ID, generating new one...');
3737
- // Generate group ID BEFORE starting any file uploads
3743
+ // Generate new group ID just before upload
3744
+ console.log('🆔 [FileInput] Generating new group ID just before upload...');
3738
3745
  this.fileManagerService.generateObjectId().subscribe({
3739
3746
  next: (response) => {
3740
3747
  const newGroupId = response.data?.objectId;
3741
- console.log('🆔 [FileInput] STEP 1 COMPLETE: Generated new group ID:', newGroupId);
3742
- console.log('🔄 [FileInput] STEP 2: Starting file uploads with group ID:', newGroupId);
3748
+ console.log('🆔 [FileInput] Generated new group ID just before upload:', newGroupId);
3749
+ // Set the group ID to this component so it can track its own files
3743
3750
  this.groupId.set(newGroupId);
3744
3751
  this.startMulti(files, newGroupId);
3745
3752
  },
@@ -4056,32 +4063,40 @@ class CideEleFileInputComponent {
4056
4063
  /**
4057
4064
  * Get total upload count from file manager service for this component's group ID
4058
4065
  * Uses optimized service method for better performance
4066
+ * Only counts files for this component's specific group ID
4059
4067
  */
4060
4068
  getUploadCount() {
4061
4069
  const groupId = this.groupId();
4062
- if (!groupId)
4063
- return this.fileManagerService.activeUploads().size;
4064
- return this.fileManagerService.getFileCountForGroup(groupId);
4070
+ const componentId = this.id();
4071
+ if (!groupId) {
4072
+ // No group ID yet - component hasn't uploaded anything, so count is 0
4073
+ return 0;
4074
+ }
4075
+ const count = this.fileManagerService.getFileCountForGroup(groupId);
4076
+ return count;
4065
4077
  }
4066
4078
  /**
4067
4079
  * Check if there are active uploads for this component's group ID
4068
4080
  * Uses optimized service method for better performance
4081
+ * Only checks files for this component's specific group ID
4069
4082
  */
4070
4083
  hasActiveUploads() {
4071
4084
  const groupId = this.groupId();
4072
4085
  if (!groupId) {
4073
- return Array.from(this.fileManagerService.activeUploads().values()).some(upload => upload.stage !== 'complete');
4086
+ // No group ID yet - component hasn't uploaded anything, so no active uploads
4087
+ return false;
4074
4088
  }
4075
4089
  return this.fileManagerService.hasActiveUploadsForGroup(groupId);
4076
4090
  }
4077
4091
  /**
4078
4092
  * Get count of active (non-completed) uploads for this component's group ID
4093
+ * Only counts files for this component's specific group ID
4079
4094
  */
4080
4095
  getActiveUploadCount() {
4081
4096
  const groupId = this.groupId();
4082
4097
  if (!groupId) {
4083
- return Array.from(this.fileManagerService.activeUploads().values())
4084
- .filter(upload => upload.stage !== 'complete').length;
4098
+ // No group ID yet - component hasn't uploaded anything, so no active uploads
4099
+ return 0;
4085
4100
  }
4086
4101
  return this.fileManagerService.getAllFilesForGroup(groupId)
4087
4102
  .filter(file => file.stage !== 'complete').length;