Skip to content

Commit

Permalink
fix native android selector
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Oct 11, 2024
1 parent 9c69446 commit 4b85825
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 0 additions & 2 deletions lib/blocs/upload/upload_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,6 @@ class UploadCubit extends Cubit<UploadState> {
}
_files.addAll(files);
emit(UploadLoadingFilesSuccess());

startUploadPreparation();
} catch (e) {
if (e is ActionCanceledException) {
emit(EmptyUpload());
Expand Down
12 changes: 11 additions & 1 deletion lib/components/upload_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,17 @@ Future<void> promptToUpload(
context: context, parentFolderId: parentFolderId);
cubit.startUploadPreparation();
} else {
cubit.pickFiles(context: context, parentFolderId: parentFolderId);
if (AppPlatform.isMobile) {
/// on mobile we need to wait for the files to be picked before starting the preparation
await cubit.pickFiles(context: context, parentFolderId: parentFolderId);
cubit.startUploadPreparation();
} else {
cubit
.pickFiles(context: context, parentFolderId: parentFolderId)
.then((value) {
cubit.startUploadPreparation();
});
}
}

final uploadCubit = BlocProvider<UploadCubit>(
Expand Down

0 comments on commit 4b85825

Please sign in to comment.