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

Loading…
Cancel
Save