Skip to content

Commit

Permalink
Merge pull request oasisprotocol#1735 from oasisprotocol/lw/fix-contacts
Browse files Browse the repository at this point in the history
Fix contacts
  • Loading branch information
buberdds authored Oct 20, 2023
2 parents fa173f7 + 296f5e6 commit 5237b6f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changelog/1735.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix contacts syncing to new tab
6 changes: 4 additions & 2 deletions src/app/pages/AccountPage/Features/SendTransaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ export function SendTransaction(props: SendTransactionProps) {
>
<TextInput
id="recipient-id"
suggestions={contacts.map(contact => contact.name)}
suggestions={contacts.map(contact => ({ label: contact.name, value: contact.address }))}
onSuggestionSelect={event =>
setRecipient(contacts.find(contact => contact.name === event.suggestion)?.address || '')
setRecipient(
contacts.find(contact => contact.address === event.suggestion?.value)?.address || '',
)
}
name="recipient"
value={recipient}
Expand Down
1 change: 1 addition & 0 deletions src/app/state/persist/syncTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export function receiveInitialTabSyncState(
...prevState,
theme: initialSyncState.theme,
wallet: initialSyncState.wallet,
contacts: initialSyncState.contacts,
network: initialSyncState.network,
persist: initialSyncState.persist,
}
Expand Down

0 comments on commit 5237b6f

Please sign in to comment.