Minor bug fixes.

This commit is contained in:
M 2021-05-11 18:37:26 +03:00
parent a439560d4d
commit f4c57e22f2
11 changed files with 75 additions and 76 deletions

View file

@ -2,100 +2,100 @@
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
"scale" : "3x",
"size" : "40x40"
},
{
"size" : "60x60",
"filename" : "app_icon_120.png",
"idiom" : "iphone",
"filename" : "cake_xmr_120.png",
"scale" : "2x"
"scale" : "2x",
"size" : "60x60"
},
{
"size" : "60x60",
"filename" : "app_icon_180.png",
"idiom" : "iphone",
"filename" : "cake_xmr_180.png",
"scale" : "3x"
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"size" : "1024x1024",
"filename" : "app_icon_1024.png",
"idiom" : "ios-marketing",
"filename" : "cake_xmr_1024.png",
"scale" : "1x"
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View file

@ -538,8 +538,7 @@ Future setup(
TradeDetailsPage(getIt.get<TradeDetailsViewModel>(param1: trade)));
getIt.registerFactory(() {
final wallet = getIt.get<AppStore>().wallet;
return WyreService(wallet: wallet);
return WyreService(appStore: getIt.get<AppStore>());
});
getIt.registerFactory(() {
@ -551,10 +550,9 @@ Future setup(
WyrePage(getIt.get<WyreViewModel>(),
ordersStore: getIt.get<OrdersStore>(), url: url));
getIt.registerFactoryParam<OrderDetailsViewModel, Order, void>(
(order, _) => OrderDetailsViewModel(
wyreViewModel: getIt.get<WyreViewModel>(),
orderForDetails: order));
getIt.registerFactoryParam<OrderDetailsViewModel, Order, void>((order, _) =>
OrderDetailsViewModel(
wyreViewModel: getIt.get<WyreViewModel>(), orderForDetails: order));
getIt.registerFactoryParam<OrderDetailsPage, Order, void>((Order order, _) =>
OrderDetailsPage(getIt.get<OrderDetailsViewModel>(param1: order)));

View file

@ -4,7 +4,8 @@ String calculateFiatAmount({double price, String cryptoAmount}) {
}
final _amount = double.parse(cryptoAmount);
final result = price * _amount;
final _result = price * _amount;
final result = _result < 0 ? _result * -1 : _result;
if (result == 0.0) {
return '0.00';

View file

@ -1,7 +1,7 @@
import 'dart:convert';
import 'package:cake_wallet/core/wallet_base.dart';
import 'package:cake_wallet/entities/wyre_exception.dart';
import 'package:cake_wallet/exchange/trade_state.dart';
import 'package:cake_wallet/store/app_store.dart';
import 'package:flutter/foundation.dart';
import 'package:http/http.dart';
import 'package:cake_wallet/.secrets.g.dart' as secrets;
@ -9,15 +9,9 @@ import 'package:cake_wallet/entities/order.dart';
import 'package:cake_wallet/entities/wallet_type.dart';
class WyreService {
WyreService({
@required this.wallet,
this.isTestEnvironment = false}) {
baseApiUrl = isTestEnvironment
? _baseTestApiUrl
: _baseProductApiUrl;
trackUrl = isTestEnvironment
? _trackTestUrl
: _trackProductUrl;
WyreService({@required this.appStore, this.isTestEnvironment = false}) {
baseApiUrl = isTestEnvironment ? _baseTestApiUrl : _baseProductApiUrl;
trackUrl = isTestEnvironment ? _trackTestUrl : _trackProductUrl;
}
static const _baseTestApiUrl = 'https://api.testwyre.com';
@ -31,24 +25,28 @@ class WyreService {
static const _trackSuffix = '/track';
final bool isTestEnvironment;
final WalletBase wallet;
final AppStore appStore;
WalletType get walletType => wallet.type;
String get walletAddress => wallet.address;
String get walletId => wallet.id;
WalletType get walletType => appStore.wallet.type;
String get walletAddress => appStore.wallet.address;
String get walletId => appStore.wallet.id;
String baseApiUrl;
String trackUrl;
Future<String> getWyreUrl() async {
final timestamp = DateTime.now().millisecondsSinceEpoch.toString();
final url = baseApiUrl + _ordersSuffix + _reserveSuffix +
_timeStampSuffix + timestamp;
final url = baseApiUrl +
_ordersSuffix +
_reserveSuffix +
_timeStampSuffix +
timestamp;
final secretKey = secrets.wyreSecretKey;
final accountId = secrets.wyreAccountId;
final body = {
'destCurrency': walletTypeToCryptoCurrency(walletType).title,
'dest': walletTypeToString(walletType).toLowerCase() + ':' + walletAddress,
'dest':
walletTypeToString(walletType).toLowerCase() + ':' + walletAddress,
'referrerAccountId': accountId,
'lockFields': ['destCurrency', 'dest']
};
@ -110,7 +108,6 @@ class WyreService {
createdAt: createdAt,
amount: amount.toString(),
receiveAddress: walletAddress,
walletId: walletId
);
walletId: walletId);
}
}

View file

@ -84,6 +84,8 @@ abstract class DashboardViewModelBase with Store {
name = appStore.wallet?.name;
wallet ??= appStore.wallet;
type = wallet.type;
isOutdatedElectrumWallet =
wallet.type == WalletType.bitcoin && wallet.seed.split(' ').length < 24;
final _wallet = wallet;
if (_wallet is MoneroWallet) {
@ -234,9 +236,8 @@ abstract class DashboardViewModelBase with Store {
await wallet.connectToNode(node: node);
}
@computed
bool get isOutdatedElectrumWallet =>
wallet.type == WalletType.bitcoin && wallet.seed.split(' ').length < 24;
@observable
bool isOutdatedElectrumWallet;
@action
void _onWalletChange(
@ -246,6 +247,8 @@ abstract class DashboardViewModelBase with Store {
this.wallet = wallet;
type = wallet.type;
name = wallet.name;
isOutdatedElectrumWallet =
wallet.type == WalletType.bitcoin && wallet.seed.split(' ').length < 24;
if (wallet is MoneroWallet) {
subname = wallet.account?.label;