Skip to content

Commit 505fea9

Browse files
committed
Merge branch v1.50.8
2 parents e0cc4ac + d73f04e commit 505fea9

File tree

33 files changed

+2983
-2322
lines changed

33 files changed

+2983
-2322
lines changed

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ android {
133133
minSdkVersion rootProject.ext.minSdkVersion
134134
targetSdkVersion rootProject.ext.targetSdkVersion
135135
versionCode 1
136-
versionName "1.50.7"
136+
versionName "1.50.8"
137137

138138
missingDimensionStrategy 'react-native-camera', 'general'
139139
multiDexEnabled true

app/appstores/Stores/CreateWallet/CreateWalletActions.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,13 @@ export async function proceedSaveGeneratedWallet(wallet, source = 'GENERATION')
8888
walletCashback : cashbackToken
8989
}
9090
const hasInternet = await ApiProxyLoad.hasInternet()
91+
let res = false
9192
if (source === 'IMPORT' && hasInternet) {
92-
const res = await ApiProxyLoad.getSaved(storedKey, wallet.walletName)
93+
try {
94+
res = await ApiProxyLoad.getSaved(storedKey, wallet.walletName)
95+
} catch (e) {
96+
// do nothing
97+
}
9398

9499
if (res && typeof res.forWalletsAll !== 'undefined' && typeof res.forWalletsAll[storedKey] !== 'undefined') {
95100
const savedWallet = res.forWalletsAll[storedKey]

app/modules/Account/AccountReceive/AccountReceiveScreen.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ class AccountReceiveScreen extends React.PureComponent {
569569
type: 'YES_NO_MODAL',
570570
title: strings('account.externalLink.title'),
571571
icon: 'WARNING',
572-
description: strings('account.externalLink.description')
572+
description: strings('account.externalLink.description'),
573+
reverse: true
573574
}, () => {
574575
trusteeAsyncStorage.setExternalAsked(now + '')
575576
CACHE_ASKED = now

app/modules/Account/AccountScreen.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ class Account extends React.PureComponent {
360360
currencyCode: selectedCryptoCurrencyData.currencyCode,
361361
currencySymbol: selectedCryptoCurrencyData.currencySymbol,
362362
currencyName: selectedCryptoCurrencyData.currencyName,
363-
currencyExplorerLink: selectedCryptoCurrencyData.currencyExplorerLink
363+
currencyExplorerLink: selectedCryptoCurrencyData.currencyExplorerLink,
364+
decimals: selectedCryptoCurrencyData.decimals
364365
}}
365366
isSegwit={isSegwit}
366367
cacheAsked={CACHE_ASKED}

app/modules/Account/AccountSettingsPrivate/elements/SettingsPrivateXMR.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class SettingsPrivateXMR extends Component {
151151
title={'Address'}
152152
subtitle={this.props.selectedAccountData.address}
153153
iconType='keyMonero'
154-
onPress={this.handlePrivate}
154+
onPress={() => this.handleCopy(this.props.selectedAccountData.address)}
155155
/>
156156
<ListItem
157157
title={'public ViewKey'}

app/modules/Account/AccountTransaction/AccountTransactionScreen.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,10 @@ class AccountTransactionScreen extends PureComponent {
259259
}
260260

261261
return <TransactionItem
262-
title={'Tx private key'}
262+
title={strings('account.transaction.txPrivateKey')}
263263
subtitle={transaction.transactionJson.secretTxKey}
264264
copyAction={() => this.handleSubContentPress({ plain: transaction.transactionJson.secretTxKey })}
265+
withoutBack
265266
/>
266267
}
267268

app/modules/Account/AccountTransaction/elements/TransactionItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const TransactionItem = (props) => {
7878
<Text style={[styles.title, { color: colors.common.text2 }]}>{title}</Text>
7979
{!!subtitle ?
8080
<TouchableDebounce onPress={handleLink ? handleLink : copyAction} onLongPress={handleLink ? copyAction : null}>
81-
<Text style={[styles.subtitle, { color: colorLink ? colorLink : colors.common.text1, textDecorationLine: colorLink ? 'underline' : null }]}>{subtitle}</Text>
81+
<Text numberOfLines={2} style={[styles.subtitle, { color: colorLink ? colorLink : colors.common.text1, textDecorationLine: colorLink ? 'underline' : null }]}>{subtitle}</Text>
8282
</TouchableDebounce> : null}
8383
</View>
8484
</View>

app/modules/Account/AccountTransaction/helper.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ export function renderReplaceByFeeRemove(array) {
231231
if (transaction.transactionBlockchainStatus !== 'new' && transaction.transactionBlockchainStatus !== 'missing') {
232232
return false
233233
}
234+
if (transaction?.wayType === 'fee') {
235+
return false
236+
}
234237
if (!BlocksoftTransfer.canRBF(account, transaction, 'REMOVE')) {
235238
Log.log('AccountTransactionScreen.helper.renderReplaceByFeeRemove could not remove', { account, transaction })
236239
return false
@@ -274,6 +277,11 @@ export function renderReplaceByFee(array) {
274277
if (!transaction.addressTo || transaction.addressTo === '') {
275278
transaction.addressTo = transaction.basicAddressTo || account.address
276279
}
280+
281+
if (transaction?.wayType === 'fee') {
282+
return false
283+
}
284+
277285
if (!BlocksoftTransfer.canRBF(account, transaction, 'REPLACE')) {
278286
Log.log('AccountTransactionScreen.helper.renderReplaceByFee could not replace', { account, transaction })
279287
return false
@@ -415,7 +423,8 @@ export function handleLink(link) {
415423
type: 'YES_NO_MODAL',
416424
title: strings('account.externalLink.title'),
417425
icon: 'WARNING',
418-
description: strings('account.externalLink.description')
426+
description: strings('account.externalLink.description'),
427+
reverse: true
419428
}, () => {
420429
trusteeAsyncStorage.setExternalAsked(now + '')
421430
this.props.cacheAsked = now

app/modules/Account/elements/HeaderBlocks.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class HeaderBlocks extends React.Component {
5353
type: 'YES_NO_MODAL',
5454
title: strings('account.externalLink.title'),
5555
icon: 'WARNING',
56-
description: strings('account.externalLink.description')
56+
description: strings('account.externalLink.description'),
57+
reverse: true
5758
}, () => {
5859
trusteeAsyncStorage.setExternalAsked(now + '')
5960
this.props.cacheAsked = now
@@ -155,7 +156,7 @@ class HeaderBlocks extends React.Component {
155156
const { isBalanceVisible, isBalanceVisibleTriggered, originalVisibility, account } = this.props
156157
const finalIsBalanceVisible = isBalanceVisibleTriggered ? isBalanceVisible : originalVisibility
157158

158-
const { currencyCode, currencySymbol } = this.props.cryptoCurrency
159+
const { currencyCode, currencySymbol, decimals } = this.props.cryptoCurrency
159160

160161
const canBeStaked = currencyCode === 'TRX' || currencyCode === 'SOL'
161162
const withoutDescription = currencyCode === 'SOL'
@@ -189,17 +190,22 @@ class HeaderBlocks extends React.Component {
189190
<TouchableDebounce
190191
onPress={() => this.accountStaking(currencyCode)}
191192
hitSlop={HIT_SLOP}
192-
disabled={withoutDescription || !canBeStaked}
193+
disabled={!canBeStaked}
193194
>
194195
{diffAvailable &&
195196
<Text style={[styles.availableText, { color: colors.common.text3, marginBottom: GRID_SIZE / 3 }]}>
196-
{`${strings('settings.walletList.available')}: ${finalIsBalanceVisible ? balanceTotalPretty + ' ' + currencySymbol : ' ****'}`}
197+
{`${strings('settings.walletList.available')}: ${finalIsBalanceVisible ? BlocksoftPrettyNumbers.makeCut(balanceTotalPretty, decimals).cutted + ' ' + currencySymbol : ' ****'}`}
197198
</Text>}
198199
{!withoutDescription &&
199200
<Text style={styles.availableText}>
200201
{`${strings(balanceStakedTitle)}: ${finalIsBalanceVisible ? balanceStakedPretty + ' ' + currencySymbol : ' ****'}`}
201202
</Text>
202203
}
204+
{!diffAvailable && withoutDescription ?
205+
<Text style={styles.availableText}>
206+
{strings('account.staking')}
207+
</Text>
208+
: null}
203209
</TouchableDebounce>
204210
{
205211
canBeStaked &&
@@ -410,16 +416,21 @@ class HeaderBlocks extends React.Component {
410416
<View style={styles.stakingValue}>
411417
<Text style={{ ...styles.currencyName, color: colors.common.text1 }}>{currencySymbol}</Text>
412418
{availableStaking &&
413-
<PercentView
414-
value={this.props.stakingCoins[currencyCode]}
415-
staking
416-
/>
419+
<TouchableDebounce
420+
hitSlop={{ top: 15, right: 15, bottom: 7, left: 10 }}
421+
onPress={() => this.accountStaking(currencyCode)}
422+
>
423+
<PercentView
424+
value={this.props.stakingCoins[currencyCode]}
425+
staking
426+
/>
427+
</TouchableDebounce>
417428
}
418429
</View>
419430
<TouchableDebounce
420431
style={styles.topContent__middle}
421432
onPress={() => this.handleBackDropModal(shownAddress, forceLink, currencyCode, currencyName)}
422-
hitSlop={HIT_SLOP}
433+
hitSlop={{ top: 6, right: 15, bottom: 15, left: 15 }}
423434
onLongPress={() => this.handleBtcAddressCopy(shownAddress)}
424435
delayLongPress={500}
425436
>

app/modules/Send/elements/InputMemo.js

Lines changed: 66 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* @version 0.41
33
*/
44
import React from 'react'
5-
import { View, StyleSheet } from 'react-native'
5+
import { View, StyleSheet, Text } from 'react-native'
66
import { connect } from 'react-redux'
7+
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'
78

89
import MemoInput from '@app/components/elements/NewInput'
910
import { ThemeContext } from '@app/theme/ThemeProvider'
@@ -20,9 +21,19 @@ class InputMemo extends React.PureComponent {
2021

2122
constructor(props) {
2223
super(props)
24+
this.state = {
25+
memoError: false
26+
}
2327
this.memoInput = React.createRef()
2428
}
2529

30+
memoName = {
31+
XRP: strings('send.xrp_memo'),
32+
XLM: strings('send.bnb_memo'),
33+
BNB: strings('send.bnb_memo'),
34+
XMR: strings('send.xmr_memo')
35+
}
36+
2637
componentDidMount() {
2738
if (typeof this.memoInput.handleInput !== 'undefined') {
2839
this.memoInput.handleInput(this.props.sendScreenStoreValue, false)
@@ -55,6 +66,9 @@ class InputMemo extends React.PureComponent {
5566

5667
async disabledGotoWhy() {
5768
if (typeof this.memoInput.handleInput === 'undefined') {
69+
this.setState({
70+
memoError: false
71+
})
5872
return {
5973
status : 'success',
6074
value : ''
@@ -63,16 +77,47 @@ class InputMemo extends React.PureComponent {
6377
const destinationTagValidation = await this.memoInput.handleValidate()
6478

6579
if (destinationTagValidation.status !== 'success') {
80+
this.setState({
81+
memoError: true
82+
})
6683
return {
6784
status : 'fail'
6885
}
6986
}
87+
this.setState({
88+
memoError: false
89+
})
7090
return {
7191
status : 'success',
7292
value : destinationTagValidation.value
7393
}
7494
}
7595

96+
renderMemoError = () => {
97+
const { memoError } = this.state
98+
const { colors, GRID_SIZE } = this.context
99+
const { currencyCode } = this.props.sendScreenStoreDict
100+
101+
if (!memoError) return
102+
return (
103+
<View style={{ marginVertical: GRID_SIZE }}>
104+
<View style={style.texts}>
105+
<View style={style.texts__icon}>
106+
<Icon
107+
name='information-outline'
108+
size={22}
109+
color='#864DD9'
110+
/>
111+
</View>
112+
<Text style={{ ...style.texts__item, color: colors.common.text3 }}>
113+
{strings('send.memoError', { name: this.memoName[currencyCode] })}
114+
</Text>
115+
</View>
116+
</View>
117+
)
118+
119+
}
120+
76121

77122
render() {
78123
const { GRID_SIZE } = this.context
@@ -86,7 +131,7 @@ class InputMemo extends React.PureComponent {
86131
<MemoInput
87132
ref={component => this.memoInput = component}
88133
id={memoInput.id}
89-
name={strings('send.xrp_memo')}
134+
name={this.memoName[currencyCode]}
90135
type={'XRP_DESTINATION_TAG'}
91136
onFocus={() => this.onFocus()}
92137
keyboardType={'numeric'}
@@ -104,7 +149,7 @@ class InputMemo extends React.PureComponent {
104149
<MemoInput
105150
ref={component => this.memoInput = component}
106151
id={memoInput.id}
107-
name={strings('send.bnb_memo')}
152+
name={this.memoName[currencyCode]}
108153
type={'XLM_DESTINATION_TAG'}
109154
onFocus={() => this.onFocus()}
110155
keyboardType={'default'}
@@ -120,7 +165,7 @@ class InputMemo extends React.PureComponent {
120165
<MemoInput
121166
ref={component => this.memoInput = component}
122167
id={memoInput.id}
123-
name={strings('send.bnb_memo')}
168+
name={this.memoName[currencyCode]}
124169
type={'BNB_DESTINATION_TAG'}
125170
onFocus={() => this.onFocus()}
126171
keyboardType={'default'}
@@ -132,11 +177,11 @@ class InputMemo extends React.PureComponent {
132177

133178
{
134179
currencyCode === 'XMR' ?
135-
<View style={{ ...style.inputWrapper, marginVertical: GRID_SIZE }}>
180+
<View style={{ ...style.inputWrapper, marginTop: GRID_SIZE }}>
136181
<MemoInput
137182
ref={component => this.memoInput = component}
138183
id={memoInput.id}
139-
name={strings('send.xmr_memo')}
184+
name={this.memoName[currencyCode]}
140185
type={'XMR_DESTINATION_TAG'}
141186
onFocus={() => this.onFocus()}
142187
keyboardType={'default'}
@@ -145,7 +190,7 @@ class InputMemo extends React.PureComponent {
145190
/>
146191
</View> : null
147192
}
148-
193+
{this.renderMemoError()}
149194
</View>
150195

151196
}
@@ -170,5 +215,19 @@ const style = StyleSheet.create({
170215
width: 0,
171216
height: 0
172217
}
218+
},
219+
texts: {
220+
flexDirection: 'row',
221+
alignItems: 'center',
222+
marginRight: 30
223+
},
224+
texts__item: {
225+
fontSize: 14,
226+
fontFamily: 'SFUIDisplay-Semibold',
227+
letterSpacing: 1
228+
},
229+
texts__icon: {
230+
marginRight: 10,
231+
transform: [{ rotate: '180deg' }]
173232
}
174233
})

0 commit comments

Comments
 (0)