From fb07535829cec28dce69b46f9cd689c0a1e82eb4 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Sun, 18 Aug 2019 12:44:46 +0200 Subject: [PATCH] [Wallet] Fix Send handling of async recip cache updates (#622) --- packages/mobile/src/send/Send.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/mobile/src/send/Send.tsx b/packages/mobile/src/send/Send.tsx index 605f2cec6c0..b2d8dbaf8d5 100644 --- a/packages/mobile/src/send/Send.tsx +++ b/packages/mobile/src/send/Send.tsx @@ -134,6 +134,21 @@ class Send extends React.Component { 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({