Works as intent ended, the address is automatically filled when you add a new address from a Tx. Checked the Address book functionality in general making sure nothing broke by this fix.
This commit is contained in:
parent
c94bf4edbd
commit
504770d4cd
|
@ -13,15 +13,16 @@ import Field from '~/components/forms/Field'
|
|||
import TextField from '~/components/forms/TextField'
|
||||
import Paragraph from '~/components/layout/Paragraph'
|
||||
import {
|
||||
composeValidators, required, minMaxLength, uniqueAddress,
|
||||
composeValidators,
|
||||
required,
|
||||
minMaxLength,
|
||||
uniqueAddress,
|
||||
} from '~/components/forms/validator'
|
||||
import Modal from '~/components/Modal'
|
||||
import { styles } from './style'
|
||||
import AddressInput from '~/components/forms/AddressInput'
|
||||
import type { AddressBookEntry } from '~/logic/addressBook/model/addressBook'
|
||||
import {
|
||||
getAddressBookListSelector,
|
||||
} from '~/logic/addressBook/store/selectors'
|
||||
import { getAddressBookListSelector } from '~/logic/addressBook/store/selectors'
|
||||
import { getAddressesListFromAdbk } from '~/logic/addressBook/utils'
|
||||
|
||||
export const CREATE_ENTRY_INPUT_NAME_ID = 'create-entry-input-name'
|
||||
|
@ -45,8 +46,8 @@ const CreateEditEntryModalComponent = ({
|
|||
entryToEdit,
|
||||
editEntryModalHandler,
|
||||
}: Props) => {
|
||||
const onFormSubmitted = (values) => {
|
||||
if (entryToEdit) {
|
||||
const onFormSubmitted = values => {
|
||||
if (entryToEdit && !entryToEdit.entry.isNew) {
|
||||
editEntryModalHandler(values)
|
||||
} else {
|
||||
newEntryModalHandler(values)
|
||||
|
|
|
@ -85,7 +85,13 @@ const AddressBookTable = ({ classes }: Props) => {
|
|||
setSelectedEntry({ entry: value, index: key })
|
||||
} else {
|
||||
// Create new entry
|
||||
setSelectedEntry(null)
|
||||
setSelectedEntry({
|
||||
entry: {
|
||||
name: '',
|
||||
address: entryAddressToEditOrCreateNew,
|
||||
isNew: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
}, [addressBook])
|
||||
|
|
Loading…
Reference in New Issue