CWA-220 | blocked possibility to edit address of current wallet in the exchange page; changed displaying subaddress when label is empty

Oleksandr Sobol committed Jun 5, 2020 at 16:07 UTC 0978792bd540389355b14d3ed52f975e3a2f1cc2
2 files changed +11 -14
lib/src/screens/receive/receive_page.dart
+3 -4
@@ -304,9 +304,6 @@ class ReceivePageState extends State<ReceivePage> {
304 final isCurrent =
305 walletStore.subaddress.address == subaddress.address;
306
307 - String shortAddress = subaddress.address;
308 - shortAddress = shortAddress.replaceRange(8, shortAddress.length - 8, '...');
309 -
307 final content = Observer(
308 builder: (_) {
309 final isShortAddressShow = subaddressListStore.isShortAddressShow[index];
@@ -315,7 +312,7 @@ class ReceivePageState extends State<ReceivePage> {
312 ? 'Primary subaddress'
313 : subaddress.label.isNotEmpty
314 ? subaddress.label
318 - : isShortAddressShow ? shortAddress : subaddress.address;
315 + : subaddress.address;
316
317 return InkWell(
318 onTap: () => walletStore.setSubaddress(subaddress),
@@ -335,6 +332,8 @@ class ReceivePageState extends State<ReceivePage> {
332 ),
333 child: Text(
334 label,
335 + maxLines: isShortAddressShow ? 1 : 10,
336 + overflow: TextOverflow.ellipsis,
337 style: TextStyle(
338 fontSize: 18,
339 fontWeight: FontWeight.bold,
lib/src/stores/exchange/exchange_store.dart
+8 -10
@@ -33,10 +33,8 @@ abstract class ExchangeStoreBase with Store {
33 provider = initialProvider;
34 depositCurrency = initialDepositCurrency;
35 receiveCurrency = initialReceiveCurrency;
36 - /*isDepositAddressEnabled = !(depositCurrency == walletStore.type);
37 - isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);*/
38 - isDepositAddressEnabled = true;
39 - isReceiveAddressEnabled = true;
36 + isDepositAddressEnabled = !(depositCurrency == walletStore.type);
37 + isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);
38 depositAmount = '';
39 receiveAmount = '';
40 depositAddress = '';
@@ -109,16 +107,16 @@ abstract class ExchangeStoreBase with Store {
107 void changeDepositCurrency({CryptoCurrency currency}) {
108 depositCurrency = currency;
109 _onPairChange();
112 - /*isDepositAddressEnabled = !(depositCurrency == walletStore.type);
113 - isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);*/
110 + isDepositAddressEnabled = !(depositCurrency == walletStore.type);
111 + isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);
112 }
113
114 @action
115 void changeReceiveCurrency({CryptoCurrency currency}) {
116 receiveCurrency = currency;
117 _onPairChange();
120 - /*isDepositAddressEnabled = !(depositCurrency == walletStore.type);
121 - isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);*/
118 + isDepositAddressEnabled = !(depositCurrency == walletStore.type);
119 + isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);
120 }
121
122 @action
@@ -242,8 +240,8 @@ abstract class ExchangeStoreBase with Store {
240 receiveCurrency = CryptoCurrency.btc;
241 depositAddress = depositCurrency == walletStore.type ? walletStore.address : '';
242 receiveAddress = receiveCurrency == walletStore.type ? walletStore.address : '';
245 - /*isDepositAddressEnabled = !(depositCurrency == walletStore.type);
246 - isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);*/
243 + isDepositAddressEnabled = !(depositCurrency == walletStore.type);
244 + isReceiveAddressEnabled = !(receiveCurrency == walletStore.type);
245 _onPairChange();
246 }
247