FIX: Seed phrase import issues

This commit is contained in:
Marcos Rodriguez 2019-08-28 18:10:42 -04:00 committed by Overtorment
parent d25f4f7ab4
commit ffaf904460
2 changed files with 26 additions and 8 deletions

View file

@ -561,11 +561,7 @@ export class BlueFormMultiInput extends Component {
selection: { start: 0, end: 0 },
};
}
onSelectionChange = ({ nativeEvent: { selection, text } }) => {
this.setState({ selection: { start: selection.end, end: selection.end } });
};
render() {
return (
<TextInput
@ -588,8 +584,6 @@ export class BlueFormMultiInput extends Component {
spellCheck={false}
{...this.props}
selectTextOnFocus={false}
onSelectionChange={this.onSelectionChange}
selection={this.state.selection}
keyboardType={Platform.OS === 'android' ? 'visible-password' : 'default'}
/>
);

View file

@ -9,7 +9,7 @@ import {
HDSegwitBech32Wallet,
} from '../../class';
import React, { Component } from 'react';
import { KeyboardAvoidingView, Dimensions, View, TouchableWithoutFeedback, Keyboard } from 'react-native';
import { KeyboardAvoidingView, Clipboard, Dimensions, View, TouchableWithoutFeedback, Keyboard } from 'react-native';
import {
BlueFormMultiInput,
BlueButtonLink,
@ -255,6 +255,7 @@ export default class WalletsImport extends Component {
<BlueFormMultiInput
value={this.state.label}
placeholder=""
contextMenuHidden
onChangeText={text => {
this.setLabel(text);
}}
@ -268,6 +269,29 @@ export default class WalletsImport extends Component {
alignItems: 'center',
}}
>
<BlueButton
disabled={this.state.isLoading}
title="Clear"
buttonStyle={{
width: width / 1.5,
}}
onPress={async () => {
this.setState({ label: '' });
}}
/>
<BlueSpacing20 />
<BlueButton
disabled={this.state.isLoading}
title="Paste Clipboard"
buttonStyle={{
width: width / 1.5,
}}
onPress={async () => {
const clipboard = await Clipboard.getString();
this.setState({ label: clipboard }, () => Keyboard.dismiss());
}}
/>
<BlueSpacing20 />
<BlueButton
disabled={!this.state.label}
title={loc.wallets.import.do_import}