diff --git a/lib/blocs/upload/upload_cubit.dart b/lib/blocs/upload/upload_cubit.dart index 8b5c1e813..b87108045 100644 --- a/lib/blocs/upload/upload_cubit.dart +++ b/lib/blocs/upload/upload_cubit.dart @@ -771,8 +771,6 @@ class UploadCubit extends Cubit { } _files.addAll(files); emit(UploadLoadingFilesSuccess()); - - startUploadPreparation(); } catch (e) { if (e is ActionCanceledException) { emit(EmptyUpload()); diff --git a/lib/components/upload_form.dart b/lib/components/upload_form.dart index 2024d99e8..e5e85454a 100644 --- a/lib/components/upload_form.dart +++ b/lib/components/upload_form.dart @@ -125,7 +125,17 @@ Future 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(