Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fixes empty data in the sort table (#8082)
Browse files Browse the repository at this point in the history
Resolves #8079

Auditors: @bsclifton

Test Plan:
- clean profile and enable payments
- visit any site so that it gets listed in the payment page
- exclude newly added site
- turn on show only included site switch and reload the page
  • Loading branch information
NejcZdovc authored and cezaraugusto committed Apr 6, 2017
1 parent 1f3cf4b commit 9fb5061
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions js/components/sortableTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ class SortableTable extends React.Component {
}
get isMultiDimensioned () {
return this.props.rows &&
Array.isArray(this.props.rows[0]) &&
(Array.isArray(this.props.rows[0][0]) || this.props.rows[0].length === 0)
Array.isArray(this.props.rows[0]) && this.entryMultiDimension
}
get entryMultiDimension () {
for (let i = 0; i < this.props.rows.length; i++) {
Expand Down Expand Up @@ -423,7 +422,7 @@ class SortableTable extends React.Component {
<tr>
{this.props.headings.map((heading, j) => {
const firstRow = this.isMultiDimensioned ? this.entryMultiDimension[0] : this.props.rows[0]
const firstEntry = this.props.rows.length > 0
const firstEntry = (firstRow && firstRow.length > 0)
? firstRow[j]
: undefined
let dataType = typeof firstEntry
Expand Down

1 comment on commit 9fb5061

@bsclifton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Please sign in to comment.