From ccb0d313873e20a3cdf31a4bc263d07e28b17100 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Fri, 21 Jun 2019 12:52:02 +0300 Subject: [PATCH] Fixed search issue on following page --- src/screens/follows/container/followsContainer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/screens/follows/container/followsContainer.js b/src/screens/follows/container/followsContainer.js index c7079d155..3d2b3c8ac 100644 --- a/src/screens/follows/container/followsContainer.js +++ b/src/screens/follows/container/followsContainer.js @@ -1,10 +1,8 @@ import React, { Component } from 'react'; +import get from 'lodash/get'; // Middleware -// Constants -import { default as ROUTES } from '../../../constants/routeNames'; - // Utilities // Services and Actions @@ -83,11 +81,13 @@ class FollowsContainer extends Component { }; _handleSearch = async text => { - const { users, username } = this.state; + const { users, username, isFollowingPress } = this.state; let newData; newData = users.filter(item => { - const itemName = item.follower.toUpperCase(); + const itemName = isFollowingPress + ? get(item, 'following').toUpperCase() + : get(item, 'follower').toUpperCase(); const _text = text.toUpperCase(); return itemName.indexOf(_text) > -1;