Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
registry accounts selector works
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Oct 25, 2016
1 parent 755dd06 commit 8a0cd0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions js/src/dapps/registry/addresses/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ export const fetch = () => (dispatch) => {
null // api.personal.accountsInfo()
])
.then(([ accounts, data ]) => {
data = data || {};
const addresses = Object.keys(data)
.filter((address) => data[address] && !data[address].meta.deleted)
.map((address) => ({
...data[address], address,
isAccount: accounts.includes(address)
}));
const addresses = accounts.map((address) => {
return { address, isAccount: true };
});
dispatch(set(addresses));
})
.catch((error) => {
Expand Down
4 changes: 2 additions & 2 deletions js/src/dapps/registry/ui/address.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const align = {
export default (address, accounts, contacts, shortenHash = true) => {
let caption;
if (accounts[address]) {
caption = (<abbr title={ address } style={ align }>{ accounts[address].name }</abbr>);
caption = (<abbr title={ address } style={ align }>{ accounts[address].name || address }</abbr>);
} else if (contacts[address]) {
caption = (<abbr title={ address } style={ align }>{ contacts[address].name }</abbr>);
caption = (<abbr title={ address } style={ align }>{ contacts[address].name || address }</abbr>);
} else {
caption = (<code style={ align }>{ shortenHash ? renderHash(address) : address }</code>);
}
Expand Down

0 comments on commit 8a0cd0e

Please sign in to comment.