From 4681e2d87c38bbe63a8ccdb98e80f67ad54867c1 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:26:29 -0300 Subject: [PATCH 1/4] fix(attach drives) --- lib/blocs/drive_detail/drive_detail_cubit.dart | 13 +++++++++++-- lib/pages/drive_detail/drive_detail_page.dart | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/blocs/drive_detail/drive_detail_cubit.dart b/lib/blocs/drive_detail/drive_detail_cubit.dart index 46b7948e0..eeea5c7c0 100644 --- a/lib/blocs/drive_detail/drive_detail_cubit.dart +++ b/lib/blocs/drive_detail/drive_detail_cubit.dart @@ -138,12 +138,21 @@ class DriveDetailCubit extends Cubit { _folderSubscription = Rx.combineLatest3( _driveRepository.watchDrive(driveId: driveId), - _driveDao.watchFolderContents( + _driveDao + .watchFolderContents( driveId, orderBy: contentOrderBy, orderingMode: contentOrderingMode, folderId: folderId, - ), + ) + .handleError((error, stack) { + logger.e('Error watching folder contents', error, stack); + if (error is DriveNotFoundException) { + emit(DriveDetailLoadNotFound()); + } + + return null; + }), _profileCubit.stream.startWith(ProfileCheckingAvailability()), (drive, folderContents, _) async { if (isClosed) { diff --git a/lib/pages/drive_detail/drive_detail_page.dart b/lib/pages/drive_detail/drive_detail_page.dart index fdb05db35..6a67e56d7 100644 --- a/lib/pages/drive_detail/drive_detail_page.dart +++ b/lib/pages/drive_detail/drive_detail_page.dart @@ -132,7 +132,8 @@ class _DriveDetailPageState extends State { child: BlocListener( listener: (context, state) { if (state is DrivesLoadSuccess) { - if (state.userDrives.isNotEmpty) { + if (state.userDrives.isNotEmpty || + state.sharedDrives.isNotEmpty) { final driveDetailState = context.read().state; if (driveDetailState is DriveDetailLoadSuccess && From 512b948ea1b86eb6f3c2d655ea12faaf87db5c1c Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:14:35 -0300 Subject: [PATCH 2/4] Update upload_cubit.dart --- lib/blocs/upload/upload_cubit.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/blocs/upload/upload_cubit.dart b/lib/blocs/upload/upload_cubit.dart index 9725014cb..a076be547 100644 --- a/lib/blocs/upload/upload_cubit.dart +++ b/lib/blocs/upload/upload_cubit.dart @@ -481,9 +481,11 @@ class UploadCubit extends Cubit { emit(readyState.copyWith( loadingArNSNames: false, showArnsCheckbox: showArnsCheckbox)); } catch (e) { - final readyState = state as UploadReady; - emit(readyState.copyWith( - loadingArNSNamesError: true, loadingArNSNames: false)); + if (state is UploadReady) { + final readyState = state as UploadReady; + emit(readyState.copyWith( + loadingArNSNamesError: true, loadingArNSNames: false)); + } } } else { emit( From 2c896a3430c8c6dec3baed580c6ac147952246fe Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:14:49 -0300 Subject: [PATCH 3/4] Update pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 801305b20..2a31dec80 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: Secure, permanent storage publish_to: 'none' -version: 2.57.2 +version: 2.57.3 environment: sdk: '>=3.2.0 <4.0.0' From 03b977dc1ed8d50fc26ec2b8a70f378de915ce96 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:18:54 -0300 Subject: [PATCH 4/4] Update upload_dispatcher.dart --- packages/ardrive_uploader/lib/src/upload_dispatcher.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/ardrive_uploader/lib/src/upload_dispatcher.dart b/packages/ardrive_uploader/lib/src/upload_dispatcher.dart index 83e634aea..f30820d79 100644 --- a/packages/ardrive_uploader/lib/src/upload_dispatcher.dart +++ b/packages/ardrive_uploader/lib/src/upload_dispatcher.dart @@ -29,6 +29,14 @@ class UploadDispatcher { }) async { try { if (task is FileUploadTask) { + logger.d('Preparing data items for file ${task.file.name}...'); + + controller.updateProgress( + task: task.copyWith( + status: UploadStatus.creatingMetadata, + ), + ); + final uploadPreparation = await prepareDataItems( file: task.file, metadata: task.metadata,