last commit broke stuff

This commit is contained in:
Connor Turland 2016-10-20 18:27:14 -04:00
parent 103ed5cbd7
commit 7a09a1c620

View file

@ -18,8 +18,14 @@ class Maps extends Component {
this.resize()
}
componentDidUpdate() {
this.resize()
componentDidUpdate(oldProps) {
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() {