Skip to content

Commit

Permalink
Use setTimeout hack to get paste context back (#1449)
Browse files Browse the repository at this point in the history
* Use setTimeout hack to get paste context back

Super weird workaround that I found here: facebook/react-native#23653 (comment)

* Move everything into a single setState call
  • Loading branch information
rickycodes authored Mar 24, 2020
1 parent e2b163b commit bcab9d8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/components/Views/SendFlow/SendTo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,14 @@ class SendFlow extends PureComponent {
const { fromAccountName } = this.state;
const networkAddressBook = addressBook[network] || {};
const ens = await doENSReverseLookup(selectedAddress, network);
this.setState({
fromAccountName: ens || fromAccountName,
fromAccountBalance: `${renderFromWei(accounts[selectedAddress].balance)} ${getTicker(ticker)}`,
inputWidth: { width: '100%' },
balanceIsZero: hexToBN(accounts[selectedAddress].balance).isZero()
});
setTimeout(() => {
this.setState({
fromAccountName: ens || fromAccountName,
fromAccountBalance: `${renderFromWei(accounts[selectedAddress].balance)} ${getTicker(ticker)}`,
balanceIsZero: hexToBN(accounts[selectedAddress].balance).isZero(),
inputWidth: { width: '100%' }
});
}, 100);
if (!Object.keys(networkAddressBook).length) {
this.addressToInputRef && this.addressToInputRef.current && this.addressToInputRef.current.focus();
}
Expand Down

0 comments on commit bcab9d8

Please sign in to comment.