Skip to content

Commit

Permalink
Merge branch 'master' into PE-7176-release-ar-drive-v-2-58-0
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Nov 21, 2024
2 parents d86e612 + 584265d commit 988e4a8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
13 changes: 11 additions & 2 deletions lib/blocs/drive_detail/drive_detail_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,21 @@ class DriveDetailCubit extends Cubit<DriveDetailState> {
_folderSubscription =
Rx.combineLatest3<Drive?, FolderWithContents, ProfileState, void>(
_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) {
Expand Down
8 changes: 5 additions & 3 deletions lib/blocs/upload/upload_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,11 @@ class UploadCubit extends Cubit<UploadState> {
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(
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/drive_detail/drive_detail_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ class _DriveDetailPageState extends State<DriveDetailPage> {
child: BlocListener<DrivesCubit, DrivesState>(
listener: (context, state) {
if (state is DrivesLoadSuccess) {
if (state.userDrives.isNotEmpty) {
if (state.userDrives.isNotEmpty ||
state.sharedDrives.isNotEmpty) {
final driveDetailState = context.read<DriveDetailCubit>().state;

if (driveDetailState is DriveDetailLoadSuccess &&
Expand Down
8 changes: 8 additions & 0 deletions packages/ardrive_uploader/lib/src/upload_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 988e4a8

Please sign in to comment.