1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/app/pages/settings/contact-list-tab
Mark Stacey 7cd609b86b
Fix crash upon removing contact (#9031)
The UI would crash upon deleting a contact from the contact list. This
happened for two reasons: the deletion could result in a re-render
before the `history.push` finished navigating back to the contact list
(it was a race condition), and the contact entry left behind an invalid
`identities` entry when it was removed.

The first problem was fixed by making the container components for view
and edit contact more tolerant of being passed an `address` that
doesn't correspond to a contact. If they are given an address without a
contact, `null` is passed to the component via the `address` prop. The
component will redirect back to the list when this happens instead
rendering. This is more awkward than I'd like, but it was the most
sensible way of handling this I could think of without making much more
drastic changes to how we're handling routing here.

The second problem was caused by the `setAccountLabel` call, which was
used to ensure the contact entry for any wallet accounts was kept
in-sync with the account label. This was being called even for non-
wallet accounts though, which is where this problem arose. This step is
now skipped for non-wallet accounts.

Fixes #9019
2020-07-20 11:55:47 -03:00
..
add-contact Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
edit-contact Fix crash upon removing contact (#9031) 2020-07-20 11:55:47 -03:00
my-accounts Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
view-contact Fix crash upon removing contact (#9031) 2020-07-20 11:55:47 -03:00
contact-list-tab.component.js eslint: Enable more react/jsx-* rules (#7592) 2019-12-03 13:05:44 -03:30
contact-list-tab.container.js Use eslint@6.8.0 (#8978) 2020-07-14 12:50:41 -02:30
index.js Address book send plus contact list (#6914) 2019-07-31 17:26:44 -02:30
index.scss Narrow usages of 037DD6 to 'primary-blue' (#9008) 2020-07-17 13:11:04 -05:00