From 1a12abfe505a185b07d7914e6e12261cd50b819c Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 2 Nov 2017 16:09:01 -0300 Subject: [PATCH] Fix bugs reported by sentry (#1081) --- app/components/drawer.js | 8 ++++---- app/components/profile_picture/index.js | 3 +-- app/screens/channel_info/index.js | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/components/drawer.js b/app/components/drawer.js index 644e6500c..05c242e14 100644 --- a/app/components/drawer.js +++ b/app/components/drawer.js @@ -21,13 +21,13 @@ export default class Drawer extends BaseDrawer { } componentDidMount() { - this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this.keyboardDidShow); - this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.keyboardDidHide); + Keyboard.addListener('keyboardDidShow', this.keyboardDidShow); + Keyboard.addListener('keyboardDidHide', this.keyboardDidHide); } componentWillUnmount() { - this.keyboardDidShowListener.remove(); - this.keyboardDidHideListener.remove(); + Keyboard.removeListener('keyboardDidShow', this.keyboardDidShow); + Keyboard.removeListener('keyboardDidHide', this.keyboardDidHide); } getMainHeight = () => '100%'; diff --git a/app/components/profile_picture/index.js b/app/components/profile_picture/index.js index bbcae7d2e..90cb284d5 100644 --- a/app/components/profile_picture/index.js +++ b/app/components/profile_picture/index.js @@ -20,8 +20,7 @@ function mapStateToProps(state, ownProps) { return { theme: ownProps.theme || getTheme(state), status, - user, - ...ownProps + user }; } diff --git a/app/screens/channel_info/index.js b/app/screens/channel_info/index.js index 917e82fdf..59999ed4e 100644 --- a/app/screens/channel_info/index.js +++ b/app/screens/channel_info/index.js @@ -35,7 +35,7 @@ function mapStateToProps(state) { const currentUserId = getCurrentUserId(state); const favoriteChannels = getSortedFavoriteChannelIds(state); const isCurrent = currentChannel.id === state.entities.channels.currentChannelId; - const isFavorite = favoriteChannels.indexOf(currentChannel.id) > -1; + const isFavorite = favoriteChannels && favoriteChannels.indexOf(currentChannel.id) > -1; const roles = getCurrentUserRoles(state); const canManageUsers = currentChannel.hasOwnProperty('id') ? canManageChannelMembers(state) : false;