Browse Source

Merge pull request #87 from loeck/master

Fix addFakeDatasOnAccounts
master
Loëck Vézien 7 years ago
committed by GitHub
parent
commit
171168bcc5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      src/components/DashboardPage.js

17
src/components/DashboardPage.js

@ -78,6 +78,7 @@ class DashboardPage extends PureComponent<Props, State> {
const listAccounts = [...accounts] const listAccounts = [...accounts]
while (listAccounts.length % ACCOUNTS_BY_LINE !== 0) listAccounts.push(null) while (listAccounts.length % ACCOUNTS_BY_LINE !== 0) listAccounts.push(null)
return chunk(listAccounts, ACCOUNTS_BY_LINE) return chunk(listAccounts, ACCOUNTS_BY_LINE)
} }
@ -91,13 +92,15 @@ class DashboardPage extends PureComponent<Props, State> {
const { accounts } = this.props const { accounts } = this.props
this.setState(prev => ({ this.setState(prev => ({
fakeDatas: accounts.reduce((res, acc, i) => { fakeDatas: [
if (res[i]) { ...accounts.reduce((res, acc, i) => {
const nextIndex = res[i].length if (res[i]) {
res[i][nextIndex] = generateFakeData(nextIndex) const nextIndex = res[i].length
} res[i][nextIndex] = generateFakeData(nextIndex)
return res }
}, prev.fakeDatas), return res
}, prev.fakeDatas),
],
})) }))
this.addFakeDatasOnAccounts() this.addFakeDatasOnAccounts()

Loading…
Cancel
Save