From 9737beaf7d0cb58f9be2c715b3e5428545ee1583 Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Fri, 26 Apr 2024 16:36:21 +0545 Subject: [PATCH 1/3] fix: Fix strange transaction details #2626 --- lib/dashboard/connection/operation/cubit/operation_state.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dashboard/connection/operation/cubit/operation_state.dart b/lib/dashboard/connection/operation/cubit/operation_state.dart index 17dc436c6..7a839af2c 100644 --- a/lib/dashboard/connection/operation/cubit/operation_state.dart +++ b/lib/dashboard/connection/operation/cubit/operation_state.dart @@ -49,8 +49,8 @@ class OperationState extends Equatable { return OperationState( status: status ?? this.status, message: message, - amount: amount ?? this.usdRate, - fee: fee ?? this.usdRate, + amount: amount ?? this.amount, + fee: fee ?? this.fee, usdRate: usdRate ?? this.usdRate, cryptoAccountData: cryptoAccountData ?? this.cryptoAccountData, dAppName: dAppName ?? this.dAppName, From fae8e2dc636701deb13d053e00709658ccd88097 Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Fri, 26 Apr 2024 16:43:23 +0545 Subject: [PATCH 2/3] fix: Attempet operation at least 3 times #2627 --- .../operation/cubit/operation_cubit.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/dashboard/connection/operation/cubit/operation_cubit.dart b/lib/dashboard/connection/operation/cubit/operation_cubit.dart index 97b122408..2f1d4ce5b 100644 --- a/lib/dashboard/connection/operation/cubit/operation_cubit.dart +++ b/lib/dashboard/connection/operation/cubit/operation_cubit.dart @@ -311,11 +311,18 @@ class OperationCubit extends Cubit { } } + int operationAttemptCount = 0; + + void resetOperationAttemptCount() { + operationAttemptCount = 0; + } + Future sendOperataion(ConnectionBridgeType connectionBridgeType) async { if (isClosed) return; try { emit(state.loading()); - log.i('sendOperataion'); + operationAttemptCount++; + log.i('sendOperataion attempt $operationAttemptCount'); final isInternetAvailable = await isConnected(); if (!isInternetAvailable) { @@ -384,12 +391,20 @@ class OperationCubit extends Cubit { ); unawaited(nftCubit.fetchFromZero()); unawaited(tokensCubit.fetchFromZero()); + resetOperationAttemptCount(); } else { throw ResponseMessage( message: ResponseString.RESPONSE_STRING_OPERATION_FAILED, ); } } catch (e) { + if (operationAttemptCount < 3) { + await Future.delayed(const Duration(milliseconds: 500)); + await sendOperataion(connectionBridgeType); + return; + } + resetOperationAttemptCount(); + log.e('sendOperataion , e: $e'); if (e is MessageHandler) { emit(state.error(messageHandler: e)); From bb9c0453c042def1153ea95f55b00f05e0044cfe Mon Sep 17 00:00:00 2001 From: Bibash Shrestha Date: Fri, 26 Apr 2024 16:44:12 +0545 Subject: [PATCH 3/3] version update to 2.4.28+448 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 32db785f0..f8fae0886 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: altme description: AltMe Flutter App -version: 2.4.27+447 +version: 2.4.28+448 environment: sdk: ">=3.1.0 <4.0.0"