Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-6896: incorrect modal display during file upload process #1887

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/blocs/upload/upload_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class UploadCubit extends Cubit<UploadState> {
_arnsRepository = arnsRepository,
_uploadRepository = uploadRepository,
_uploadThumbnail = configService.config.uploadThumbnails,
super(UploadLoadingFiles());
super(uploadFolders ? UploadLoadingFolders() : UploadLoadingFiles());

// Dependencies
final UploadRepository _uploadRepository;
Expand Down
2 changes: 2 additions & 0 deletions lib/blocs/upload/upload_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,5 @@ enum UploadErrors {
turboTimeout,
unknown,
}

class UploadLoadingFolders extends UploadState {}
50 changes: 24 additions & 26 deletions lib/components/upload_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,34 +60,32 @@ Future<void> promptToUpload(
}) async {
final driveDetailCubit = context.read<DriveDetailCubit>();

final uploadCubit = BlocProvider<UploadCubit>(
create: (context) {
final cubit = UploadCubit(
activityTracker: context.read<ActivityTracker>(),
arDriveUploadManager: context.read<ArDriveUploadPreparationManager>(),
uploadFileSizeChecker: context.read<UploadFileSizeChecker>(),
driveId: driveId,
parentFolderId: parentFolderId,
profileCubit: context.read<ProfileCubit>(),
driveDao: context.read<DriveDao>(),
uploadFolders: isFolderUpload,
auth: context.read<ArDriveAuth>(),
configService: context.read<ConfigService>(),
arnsRepository: context.read<ARNSRepository>(),
uploadRepository: context.read<UploadRepository>(),
);
final cubit = UploadCubit(
activityTracker: context.read<ActivityTracker>(),
arDriveUploadManager: context.read<ArDriveUploadPreparationManager>(),
uploadFileSizeChecker: context.read<UploadFileSizeChecker>(),
driveId: driveId,
parentFolderId: parentFolderId,
profileCubit: context.read<ProfileCubit>(),
driveDao: context.read<DriveDao>(),
uploadFolders: isFolderUpload,
auth: context.read<ArDriveAuth>(),
configService: context.read<ConfigService>(),
arnsRepository: context.read<ARNSRepository>(),
uploadRepository: context.read<UploadRepository>(),
);

if (files != null) {
cubit.selectFiles(files, parentFolderId);
} else if (isFolderUpload) {
cubit.pickFilesFromFolder(
context: context, parentFolderId: parentFolderId);
} else {
cubit.pickFiles(context: context, parentFolderId: parentFolderId);
}
if (files != null) {
cubit.selectFiles(files, parentFolderId);
} else if (isFolderUpload) {
await cubit.pickFilesFromFolder(
context: context, parentFolderId: parentFolderId);
} else {
cubit.pickFiles(context: context, parentFolderId: parentFolderId);
}

return cubit;
},
final uploadCubit = BlocProvider<UploadCubit>(
create: (context) => cubit,
);

final uploadPaymentMethodBloc = BlocProvider(
Expand Down
2 changes: 1 addition & 1 deletion packages/ardrive_ui/lib/src/components/check_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class ArDriveCheckBoxState extends State<ArDriveCheckBox> {
state == CheckBoxState.indeterminate
? ArDriveIcon(
icon: ArDriveIconsData.minus_rectangle,
size: 22,
size: 25,
color:
ArDriveTheme.of(context).themeData.colors.themeFgDefault,
)
Expand Down
Loading