From 7a09a1c620a444db8b44728a192ead8a9a67a489 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Thu, 20 Oct 2016 18:27:14 -0400 Subject: [PATCH] last commit broke stuff --- frontend/src/components/Maps/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Maps/index.js b/frontend/src/components/Maps/index.js index ecc991d9..670f5aaf 100644 --- a/frontend/src/components/Maps/index.js +++ b/frontend/src/components/Maps/index.js @@ -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() {