Show only known accounts/wallets/addresses on Home (#4612)
* Don't render unknown entries * Only render non-null items * Remove (now) invalid failing test
This commit is contained in:
parent
72998d3ce3
commit
44769fcd4a
@ -46,10 +46,18 @@ export default class SectionList extends Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
const rendered = items
|
||||
.map(this.renderItem)
|
||||
.filter((item) => item);
|
||||
|
||||
if (!rendered.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<section className={ [styles.section, className].join(' ') }>
|
||||
{ this.renderOverlay() }
|
||||
{ chunkArray(items, ITEMS_PER_ROW).map(this.renderRow) }
|
||||
{ chunkArray(rendered, ITEMS_PER_ROW).map(this.renderRow) }
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@ -74,11 +82,7 @@ export default class SectionList extends Component {
|
||||
className={ styles.row }
|
||||
key={ `row_${index}` }
|
||||
>
|
||||
{
|
||||
row
|
||||
.map(this.renderItem)
|
||||
.filter((item) => item)
|
||||
}
|
||||
{ row }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -74,10 +74,6 @@ describe('SectionList', () => {
|
||||
it('adds a key for the row', () => {
|
||||
expect(row.key).to.be.ok;
|
||||
});
|
||||
|
||||
it('calls renderItem for the items', () => {
|
||||
expect(instance.renderItem).to.have.been.calledTwice;
|
||||
});
|
||||
});
|
||||
|
||||
describe('renderItem', () => {
|
||||
|
@ -80,7 +80,12 @@ class Accounts extends Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
const account = accountsInfo[history.entry] || { meta: {} };
|
||||
const account = accountsInfo[history.entry];
|
||||
|
||||
if (!account) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let linkType = 'addresses';
|
||||
|
||||
if (account.uuid) {
|
||||
|
Loading…
Reference in New Issue
Block a user