Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE-6233: Release ardrive app v2.47.0 #1760

Merged
merged 14 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/130.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Improves handling of a few common errors
- Enhances empty drive and folder view
4 changes: 4 additions & 0 deletions lib/blocs/drives/drives_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ class DrivesCubit extends Cubit<DrivesState> {
drivesWithAlerts: const [],
canCreateNewDrive: false);

if (isClosed) {
return;
}

emit(state);
}

Expand Down
6 changes: 4 additions & 2 deletions lib/components/folder_create_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class _FolderCreateFormState extends State<FolderCreateForm> {
showProgressDialog(
context,
title: appLocalizationsOf(context).creatingFolderEmphasized,
useNewArDriveUI: true,
);
} else if (state is FolderCreateSuccess) {
Navigator.pop(context);
Expand All @@ -91,14 +92,15 @@ class _FolderCreateFormState extends State<FolderCreateForm> {
description: appLocalizationsOf(context).entityAlreadyExists(
state.folderName,
),
useNewArDriveUI: true,
);
}
},
builder: (context, state) => ArDriveStandardModal(
builder: (context, state) => ArDriveStandardModalNew(
title: appLocalizationsOf(context).createFolderEmphasized,
content: SizedBox(
width: kMediumDialogWidth,
child: ArDriveTextField(
child: ArDriveTextFieldNew(
controller: _folderNameController,
autofocus: true,
onFieldSubmitted: (value) {
Expand Down
25 changes: 9 additions & 16 deletions lib/components/pin_file_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ class PinFileDialog extends StatelessWidget {
final idValidationError = _getIdValidationError(context, state);
final nameValidationError = _getNameValidationError(context, state);

return ArDriveStandardModal(
return ArDriveStandardModalNew(
title: appLocalizationsOf(context).newFilePin,
content: SizedBox(
width: kMediumDialogWidth,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ArDriveTextField(
ArDriveTextFieldNew(
isEnabled: state is! PinFileNetworkCheckRunning,
label: appLocalizationsOf(context).enterTxIdOrFileId,
isFieldRequired: true,
Expand All @@ -119,7 +119,7 @@ class PinFileDialog extends StatelessWidget {
);
},
),
ArDriveTextField(
ArDriveTextFieldNew(
isEnabled: true,
label: appLocalizationsOf(context).enterFileName,
isFieldRequired: true,
Expand Down Expand Up @@ -154,10 +154,6 @@ class PinFileDialog extends StatelessWidget {
}

String? _getIdValidationError(BuildContext context, PinFileState state) {
// if (state is PinFileInitial) {
// return null;
// }

if (state.idValidation == IdValidationResult.invalid) {
return appLocalizationsOf(context).theIdProvidedIsNotValid;
} else if (state.idValidation == IdValidationResult.required) {
Expand All @@ -183,10 +179,6 @@ class PinFileDialog extends StatelessWidget {
}

String? _getNameValidationError(BuildContext context, PinFileState state) {
// if (state is PinFileInitial) {
// return null;
// }

if (state.nameValidation == NameValidationResult.invalid) {
return appLocalizationsOf(context).validationInvalid;
} else if (state.nameValidation == NameValidationResult.required) {
Expand All @@ -197,21 +189,22 @@ class PinFileDialog extends StatelessWidget {
return null;
}

ArDriveStandardModal _errorDialog(
ArDriveStandardModalNew _errorDialog(
BuildContext context, {
required String errorText,
bool doublePop = false,
}) =>
ArDriveStandardModal(
ArDriveStandardModalNew(
width: kMediumDialogWidth,
title: appLocalizationsOf(context).failedToCreatePin,
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 16),
Text(errorText),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
child: Text(errorText),
),
],
),
actions: [
Expand Down
2 changes: 2 additions & 0 deletions lib/components/progress_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ Future<void> showProgressDialog(
BuildContext context, {
required String title,
List<ModalAction>? actions,
bool useNewArDriveUI = false,
}) =>
showArDriveDialog(
context,
barrierDismissible: false,
content: ProgressDialog(
title: title,
actions: actions ?? const [],
useNewArDriveUI: useNewArDriveUI,
),
);

Expand Down
8 changes: 7 additions & 1 deletion lib/core/crypto/crypto.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ class ArDriveCrypto {
final cipherIvTag = transaction.getTag(EntityTag.cipherIv);

if (cipher == null || cipherIvTag == null) {
throw MissingCipherTagException();
throw MissingCipherTagException(
corruptedDataAppVersion: transaction.getTag(EntityTag.appVersion),
corruptedTransactionId: transaction.id,
);
}

final cipherIv = utils.decodeBase64ToBytes(cipherIvTag);
Expand Down Expand Up @@ -128,6 +131,7 @@ class ArDriveCrypto {
} else {
throw UnknownCipherException(
corruptedDataAppVersion: transaction.getTag(EntityTag.appVersion),
corruptedTransactionId: transaction.id,
);
}

Expand All @@ -143,6 +147,7 @@ class ArDriveCrypto {
/// Unknow error
throw TransactionDecryptionException(
corruptedDataAppVersion: transaction.getTag(EntityTag.appVersion),
corruptedTransactionId: transaction.id,
);
}
}
Expand All @@ -161,6 +166,7 @@ class ArDriveCrypto {
if (cipher == null || cipherIvTag == null) {
throw MissingCipherTagException(
corruptedDataAppVersion: transaction.getTag(EntityTag.appVersion),
corruptedTransactionId: transaction.id,
);
}

Expand Down
Loading
Loading