last commit broke stuff
This commit is contained in:
parent
103ed5cbd7
commit
7a09a1c620
1 changed files with 8 additions and 2 deletions
|
@ -18,8 +18,14 @@ class Maps extends Component {
|
||||||
this.resize()
|
this.resize()
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate(oldProps) {
|
||||||
this.resize()
|
const { maps, user, currentUser } = this.props
|
||||||
|
const oldMaps = oldProps.maps
|
||||||
|
const oldUser = oldProps.user
|
||||||
|
const oldCurrentUser = oldProps.currentUser
|
||||||
|
const numCards = maps.length + (user || currentUser ? 1 : 0)
|
||||||
|
const oldNumCards = oldMaps.length + (oldUser || oldCurrentUser ? 1 : 0)
|
||||||
|
if (numCards !== oldNumCards) this.resize()
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
|
Loading…
Reference in a new issue