From 76eb5d06fd18e8a782058f894803c937cd048b1a Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 28 Sep 2017 13:53:27 -0400 Subject: [PATCH] Fixed drawer rendering empty if the user is only on one team (#963) --- .../channel_drawer/channel_drawer.js | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/app/components/channel_drawer/channel_drawer.js b/app/components/channel_drawer/channel_drawer.js index 6695d64bd..b2c71c2a5 100644 --- a/app/components/channel_drawer/channel_drawer.js +++ b/app/components/channel_drawer/channel_drawer.js @@ -316,25 +316,23 @@ export default class ChannelDrawer extends PureComponent { } = this.state; const showTeams = openDrawerOffset !== 0 && teamsCount > 1; - - let teams; - if (showTeams) { - teams = ( - - - - ); - - if (this.drawerSwiper) { + if (this.drawerSwiper) { + if (showTeams) { this.drawerSwiper.getWrappedInstance().runOnLayout(); + } else if (!openDrawerOffset) { + this.drawerSwiper.getWrappedInstance().scrollToStart(); } - } else if (this.drawerSwiper && !openDrawerOffset) { - this.drawerSwiper.getWrappedInstance().scrollToStart(); } + const teamsList = ( + + + + ); + const channelsList = ( - {teams} + {teamsList} {channelsList} );