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 TextField from '~/components/forms/TextField'
|
||||||
import Paragraph from '~/components/layout/Paragraph'
|
import Paragraph from '~/components/layout/Paragraph'
|
||||||
import {
|
import {
|
||||||
composeValidators, required, minMaxLength, uniqueAddress,
|
composeValidators,
|
||||||
|
required,
|
||||||
|
minMaxLength,
|
||||||
|
uniqueAddress,
|
||||||
} from '~/components/forms/validator'
|
} from '~/components/forms/validator'
|
||||||
import Modal from '~/components/Modal'
|
import Modal from '~/components/Modal'
|
||||||
import { styles } from './style'
|
import { styles } from './style'
|
||||||
import AddressInput from '~/components/forms/AddressInput'
|
import AddressInput from '~/components/forms/AddressInput'
|
||||||
import type { AddressBookEntry } from '~/logic/addressBook/model/addressBook'
|
import type { AddressBookEntry } from '~/logic/addressBook/model/addressBook'
|
||||||
import {
|
import { getAddressBookListSelector } from '~/logic/addressBook/store/selectors'
|
||||||
getAddressBookListSelector,
|
|
||||||
} from '~/logic/addressBook/store/selectors'
|
|
||||||
import { getAddressesListFromAdbk } from '~/logic/addressBook/utils'
|
import { getAddressesListFromAdbk } from '~/logic/addressBook/utils'
|
||||||
|
|
||||||
export const CREATE_ENTRY_INPUT_NAME_ID = 'create-entry-input-name'
|
export const CREATE_ENTRY_INPUT_NAME_ID = 'create-entry-input-name'
|
||||||
|
@ -45,8 +46,8 @@ const CreateEditEntryModalComponent = ({
|
||||||
entryToEdit,
|
entryToEdit,
|
||||||
editEntryModalHandler,
|
editEntryModalHandler,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const onFormSubmitted = (values) => {
|
const onFormSubmitted = values => {
|
||||||
if (entryToEdit) {
|
if (entryToEdit && !entryToEdit.entry.isNew) {
|
||||||
editEntryModalHandler(values)
|
editEntryModalHandler(values)
|
||||||
} else {
|
} else {
|
||||||
newEntryModalHandler(values)
|
newEntryModalHandler(values)
|
||||||
|
|
|
@ -85,7 +85,13 @@ const AddressBookTable = ({ classes }: Props) => {
|
||||||
setSelectedEntry({ entry: value, index: key })
|
setSelectedEntry({ entry: value, index: key })
|
||||||
} else {
|
} else {
|
||||||
// Create new entry
|
// Create new entry
|
||||||
setSelectedEntry(null)
|
setSelectedEntry({
|
||||||
|
entry: {
|
||||||
|
name: '',
|
||||||
|
address: entryAddressToEditOrCreateNew,
|
||||||
|
isNew: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [addressBook])
|
}, [addressBook])
|
||||||
|
|
Loading…
Reference in New Issue