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;