Browse Source

FIX: If slider value < 1, force it to 1.

nonetwork
Marcos Rodriguez Vélez 6 years ago
parent
commit
a2ed103cef
  1. 2
      .flowconfig
  2. 17
      screen/send/details.js
  3. 1
      screen/wallets/add.js

2
.flowconfig

@ -67,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
[version]
^0.85.0
^0.86.0

17
screen/send/details.js

@ -392,7 +392,12 @@ export default class SendDetails extends Component {
<Modal
isVisible={this.state.isFeeSelectionModalVisible}
style={styles.bottomModal}
onBackdropPress={() => this.setState({ isFeeSelectionModalVisible: false })}
onBackdropPress={() => {
if (this.state.fee < 1 || this.state.feeSliderValue < 1) {
this.setState({ fee: Number(1), feeSliderValue: Number(1) });
}
this.setState({ isFeeSelectionModalVisible: false });
}}
>
<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'position' : null}>
<View style={styles.modalContent}>
@ -403,12 +408,14 @@ export default class SendDetails extends Component {
this.textInput = ref;
}}
value={this.state.fee.toString()}
onEndEditing={() => {
if (this.state.fee < 1 || this.state.feeSliderValue < 1) {
this.setState({ fee: Number(1), feeSliderValue: Number(1) });
}
}}
onChangeText={value => {
let newValue = value.replace(/\D/g, '');
if (newValue.length === 0) {
newValue = 1;
}
this.setState({ fee: newValue, feeSliderValue: newValue });
this.setState({ fee: Number(newValue), feeSliderValue: Number(newValue) });
}}
maxLength={9}
editable={!this.state.isLoading}

1
screen/wallets/add.js

@ -98,6 +98,7 @@ export default class WalletsAdd extends Component {
onChangeText={text => {
this.setLabel(text);
}}
autoFocus
style={{ flex: 1, marginHorizontal: 8, color: '#81868e' }}
editable={!this.state.isLoading}
underlineColorAndroid="transparent"

Loading…
Cancel
Save