Skip to content

Commit

Permalink
Merge pull request #1923 from ardriveapp/fix-upload-state-match
Browse files Browse the repository at this point in the history
hotfix(upload): fix upload state match
  • Loading branch information
thiagocarvalhodev authored Nov 21, 2024
2 parents b482359 + 03b977d commit 584265d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/blocs/upload/upload_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,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
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
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 584265d

Please sign in to comment.