Merge pull request #916 from esteemapp/bugfix/following-searh

Fixed search issue on following page
This commit is contained in:
uğur erdal 2019-06-21 13:15:46 +03:00 committed by GitHub
commit 370318dfd8

View File

@ -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;