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. 5
      src/components/DashboardPage.js

5
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: [
...accounts.reduce((res, acc, i) => {
if (res[i]) { if (res[i]) {
const nextIndex = res[i].length const nextIndex = res[i].length
res[i][nextIndex] = generateFakeData(nextIndex) res[i][nextIndex] = generateFakeData(nextIndex)
} }
return res return res
}, prev.fakeDatas), }, prev.fakeDatas),
],
})) }))
this.addFakeDatasOnAccounts() this.addFakeDatasOnAccounts()

Loading…
Cancel
Save