mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
Generic fixes and enhancements (#1083)
* Add exception handler to fiat APIs Increase send card size for coin control Fix Monero.com unspent coins hive box issue minor bug fix * Remove EIP-1559 parameters from Eth transaction Enhance error reporting * Throw error if not enough monero utx outputs are selected * Fix Search text color * Fix Ethereum sending EIP-1559 transactions * Add transaction data to ERC20 transactions * Add input check in single output transactions as well * Fix Node deletion issue Handle user input error in anonpay * Remove exception handler from fiat conversion since it's not working with isolates * Require enough utxo for amount and fees; More insightful Error messages * Add cakewallet to applinks [skip ci] * Add cakewallet app link for iOS [skip ci] * Add applink depending on app scheme variable * Add applink in iOS custom to the app getting built [skip ci] * Handle normal app links without considering them as Payment URIs * Minor fix [skip ci] * Fixate encrypt package version as the recent update they made has some issues [skip ci] --------- Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
This commit is contained in:
co-authored by
Konstantin Ullrich
parent
4c9c6a1eae
commit
ce4d375abf
+1
-1
@@ -114,7 +114,7 @@ Future<void> initializeAppConfigs() async {
|
||||
CakeHive.registerAdapter(OrderAdapter());
|
||||
}
|
||||
|
||||
if (!isMoneroOnly && !CakeHive.isAdapterRegistered(UnspentCoinsInfo.typeId)) {
|
||||
if (!CakeHive.isAdapterRegistered(UnspentCoinsInfo.typeId)) {
|
||||
CakeHive.registerAdapter(UnspentCoinsInfoAdapter());
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.da
|
||||
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
|
||||
import 'package:cake_wallet/themes/extensions/address_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/menu_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/picker_theme.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/home_settings_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||
@@ -55,7 +56,8 @@ class HomeSettingsPage extends BasePage {
|
||||
padding: const EdgeInsetsDirectional.only(start: 16),
|
||||
child: TextFormField(
|
||||
controller: _searchController,
|
||||
style: TextStyle(color: Theme.of(context).dialogTheme.backgroundColor),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).extension<PickerTheme>()!.searchHintColor),
|
||||
decoration: InputDecoration(
|
||||
hintText: S.of(context).search_add_token,
|
||||
prefixIcon: Image.asset("assets/images/search_icon.png"),
|
||||
|
||||
@@ -140,7 +140,7 @@ class RootState extends State<Root> with WidgetsBindingObserver {
|
||||
}
|
||||
_reset();
|
||||
totpAuth.close(
|
||||
route: launchUri != null ? Routes.send : null,
|
||||
route: _isValidPaymentUri() ? Routes.send : null,
|
||||
arguments: PaymentRequest.fromUri(launchUri),
|
||||
);
|
||||
launchUri = null;
|
||||
@@ -152,7 +152,7 @@ class RootState extends State<Root> with WidgetsBindingObserver {
|
||||
} else {
|
||||
_reset();
|
||||
auth.close(
|
||||
route: launchUri != null ? Routes.send : null,
|
||||
route: _isValidPaymentUri() ? Routes.send : null,
|
||||
arguments: PaymentRequest.fromUri(launchUri),
|
||||
);
|
||||
launchUri = null;
|
||||
@@ -161,7 +161,7 @@ class RootState extends State<Root> with WidgetsBindingObserver {
|
||||
},
|
||||
);
|
||||
});
|
||||
} else if (launchUri != null) {
|
||||
} else if (_isValidPaymentUri()) {
|
||||
widget.navigatorKey.currentState?.pushNamed(
|
||||
Routes.send,
|
||||
arguments: PaymentRequest.fromUri(launchUri),
|
||||
@@ -183,4 +183,6 @@ class RootState extends State<Root> with WidgetsBindingObserver {
|
||||
_isInactive = value;
|
||||
_isInactiveController.add(value);
|
||||
}
|
||||
|
||||
bool _isValidPaymentUri() => launchUri?.path.isNotEmpty ?? false;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class SendPage extends BasePage {
|
||||
AppBarStyle get appBarStyle => AppBarStyle.transparent;
|
||||
|
||||
double _sendCardHeight(BuildContext context) {
|
||||
final double initialHeight = sendViewModel.hasCoinControl ? 490 : 465;
|
||||
final double initialHeight = sendViewModel.hasCoinControl ? 500 : 465;
|
||||
|
||||
if (!ResponsiveLayoutUtil.instance.isMobile) {
|
||||
return initialHeight - 66;
|
||||
|
||||
@@ -34,13 +34,12 @@ class ManageNodesPage extends BasePage {
|
||||
SizedBox(height: 20),
|
||||
Observer(
|
||||
builder: (BuildContext context) {
|
||||
int itemsCount = nodeListViewModel.nodes.length;
|
||||
return Flexible(
|
||||
child: SectionStandardList(
|
||||
sectionCount: 1,
|
||||
dividerPadding: EdgeInsets.symmetric(horizontal: 24),
|
||||
itemCounter: (int sectionIndex) {
|
||||
return nodeListViewModel.nodes.length;
|
||||
},
|
||||
itemCounter: (int sectionIndex) => itemsCount,
|
||||
itemBuilder: (_, index) {
|
||||
return Observer(
|
||||
builder: (context) {
|
||||
|
||||
@@ -32,6 +32,14 @@ class ExceptionHandler {
|
||||
const String separator = '''\n\n==========================================================
|
||||
==========================================================\n\n''';
|
||||
|
||||
/// don't save existing errors
|
||||
if (file.existsSync()) {
|
||||
final String fileContent = await file.readAsString();
|
||||
if (fileContent.contains("${exception.values.first}")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
file.writeAsStringSync(
|
||||
"$exception $separator",
|
||||
mode: FileMode.append,
|
||||
@@ -83,6 +91,10 @@ class ExceptionHandler {
|
||||
library: errorDetails.library,
|
||||
);
|
||||
|
||||
if (errorDetails.silent) {
|
||||
return;
|
||||
}
|
||||
|
||||
final sharedPrefs = await SharedPreferences.getInstance();
|
||||
|
||||
final lastPopupDate =
|
||||
|
||||
@@ -93,7 +93,11 @@ abstract class AnonInvoicePageViewModelBase with Store {
|
||||
Future<void> createInvoice() async {
|
||||
state = IsExecutingState();
|
||||
if (amount.isNotEmpty) {
|
||||
final amountInCrypto = double.parse(amount);
|
||||
final amountInCrypto = double.tryParse(amount);
|
||||
if (amountInCrypto == null) {
|
||||
state = FailureState('Amount is invalid');
|
||||
return;
|
||||
}
|
||||
if (minimum != null && amountInCrypto < minimum!) {
|
||||
state = FailureState('Amount is too small');
|
||||
return;
|
||||
|
||||
@@ -225,7 +225,7 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
|
||||
|
||||
@computed
|
||||
List<WalletContact> get walletContactsToShow => contactListViewModel.walletContacts
|
||||
.where((element) => receiveCurrency == null || element.type == receiveCurrency)
|
||||
.where((element) => element.type == receiveCurrency)
|
||||
.toList();
|
||||
|
||||
@action
|
||||
@@ -550,6 +550,9 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
|
||||
amount = amount.replaceAll(',', '.');
|
||||
|
||||
if (limitsState is LimitsLoadedSuccessfully) {
|
||||
if (double.tryParse(amount) == null) {
|
||||
continue;
|
||||
}
|
||||
if (limits.max != null && double.parse(amount) < limits.min!) {
|
||||
continue;
|
||||
} else if (limits.max != null && double.parse(amount) > limits.max!) {
|
||||
|
||||
Reference in New Issue
Block a user