Skip to content

Commit

Permalink
[Wallet] Fix Send handling of async recip cache updates (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrossy committed Aug 18, 2019
1 parent a27f992 commit fb07535
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/mobile/src/send/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,21 @@ class Send extends React.Component<Props, State> {
this.setState({ hasGivenPermission })
}

componentDidUpdate(prevPops: Props) {
const { recentRecipients, allRecipients } = this.props

if (
recentRecipients !== prevPops.recentRecipients ||
allRecipients !== prevPops.allRecipients
) {
this.setState({
loading: false,
recentFiltered: filterRecipients(recentRecipients, this.state.searchQuery, false),
allFiltered: filterRecipients(allRecipients, this.state.searchQuery, true),
})
}
}

onSearchQueryChanged = (searchQuery: string) => {
this.props.hideAlert()
this.setState({
Expand Down

0 comments on commit fb07535

Please sign in to comment.