Skip to content

Commit

Permalink
fix: correctly save new contacts after add new multisig (#2664)
Browse files Browse the repository at this point in the history
* fix: correctly save new contacts after add new multisig
* fix: edit name for contacts
  • Loading branch information
Asmadek authored Nov 15, 2024
1 parent 53c448e commit 5b83e03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/renderer/entities/contact/model/contact-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const createContactFx = createEffect(async (contact: Omit<Contact, 'id'>): Promi
return storageService.contacts.create(contact);
});

const createContactsFx = createEffect((contacts: Omit<Contact, 'id'>[]): Promise<Contact | undefined>[] => {
return contacts.map(async (contact) => storageService.contacts.create(contact));
const createContactsFx = createEffect((contacts: Omit<Contact, 'id'>[]): Promise<Contact[] | undefined> => {
return storageService.contacts.createAll(contacts);
});

const updateContactFx = createEffect(async ({ id, ...rest }: Contact): Promise<Contact> => {
Expand All @@ -34,7 +34,7 @@ $contacts
.on(populateContactsFx.doneData, (_, contacts) => {
return contacts;
})
.on(createContactFx.doneData, (state, contact) => {
.on([createContactFx.doneData, createContactsFx.doneData], (state, contact) => {
return contact ? state.concat(contact) : state;
})
.on(deleteContactFx.doneData, (state, contactId) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export const Signatory = ({
placeholder={t('addressBook.createContact.namePlaceholder')}
invalid={false}
value={signatoryName}
disabled={!!ownAccountName || !!contactAccountName}
disabled={!!ownAccountName}
onChange={onNameChange}
/>
</div>
Expand Down

0 comments on commit 5b83e03

Please sign in to comment.