{"action":"created","comment":{"url":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/comments/142469231","pull_request_review_id":66824386,"id":142469231,"diff_hunk":"@@ -150,145 +126,65 @@ export default class ChannelMention extends Component {\n         }\n \n         onChangeText(completedDraft, true);\n-        this.setState({\n-            active: false,\n-            mentionComplete: true,\n-            matchTerm: `${mention} `\n-        });\n+        this.setState({mentionComplete: true});\n     };\n \n-    renderSectionHeader = (sectionData, sectionId) => {\n-        const style = getStyleFromTheme(this.props.theme);\n-\n-        const localization = {\n-            myChannels: {\n-                id: 'suggestion.mention.channels',\n-                defaultMessage: 'My Channels'\n-            },\n-            otherChannels: {\n-                id: 'suggestion.mention.morechannels',\n-                defaultMessage: 'Other Channels'\n-            }\n-        };\n+    keyExtractor = (item) => {\n+        return item.id || item;","path":"app/components/autocomplete/channel_mention/channel_mention.js","position":224,"original_position":224,"commit_id":"a0439dd6d7bf6f1c29e3c9b2addb257685e6cc64","original_commit_id":"a0439dd6d7bf6f1c29e3c9b2addb257685e6cc64","user":{"login":"hmhealey","id":3277310,"avatar_url":"https://avatars3.githubusercontent.com/u/3277310?v=4","gravatar_id":"","url":"https://api.github.com/users/hmhealey","html_url":"https://github.com/hmhealey","followers_url":"https://api.github.com/users/hmhealey/followers","following_url":"https://api.github.com/users/hmhealey/following{/other_user}","gists_url":"https://api.github.com/users/hmhealey/gists{/gist_id}","starred_url":"https://api.github.com/users/hmhealey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmhealey/subscriptions","organizations_url":"https://api.github.com/users/hmhealey/orgs","repos_url":"https://api.github.com/users/hmhealey/repos","events_url":"https://api.github.com/users/hmhealey/events{/privacy}","received_events_url":"https://api.github.com/users/hmhealey/received_events","type":"User","site_admin":false},"body":"And here about the `|| item` being unnecessary","created_at":"2017-10-03T17:33:12Z","updated_at":"2017-10-03T17:54:41Z","html_url":"https://github.com/mattermost/mattermost-mobile/pull/988#discussion_r142469231","pull_request_url":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/988","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/comments/142469231"},"html":{"href":"https://github.com/mattermost/mattermost-mobile/pull/988#discussion_r142469231"},"pull_request":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/988"}}},"pull_request":{"url":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/988","id":144450424,"html_url":"https://github.com/mattermost/mattermost-mobile/pull/988","diff_url":"https://github.com/mattermost/mattermost-mobile/pull/988.diff","patch_url":"https://github.com/mattermost/mattermost-mobile/pull/988.patch","issue_url":"https://api.github.com/repos/mattermost/mattermost-mobile/issues/988","number":988,"state":"open","locked":false,"title":"RN-382 Refactor at_mention & channel_mention autocomplete","user":{"login":"enahum","id":6757047,"avatar_url":"https://avatars1.githubusercontent.com/u/6757047?v=4","gravatar_id":"","url":"https://api.github.com/users/enahum","html_url":"https://github.com/enahum","followers_url":"https://api.github.com/users/enahum/followers","following_url":"https://api.github.com/users/enahum/following{/other_user}","gists_url":"https://api.github.com/users/enahum/gists{/gist_id}","starred_url":"https://api.github.com/users/enahum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enahum/subscriptions","organizations_url":"https://api.github.com/users/enahum/orgs","repos_url":"https://api.github.com/users/enahum/repos","events_url":"https://api.github.com/users/enahum/events{/privacy}","received_events_url":"https://api.github.com/users/enahum/received_events","type":"User","site_admin":false},"body":"#### Summary\r\nThis PR refactors the autocomplete for at_mentions and channel_mentions, the same components are used for the `postTextBox` and the search screen.\r\n\r\nI've added a few selectors that will take care of filtering depending on the term to match and they will only return the ids for users or channels, that way we'll prevent the *SectionList* from re-rendering if not necessary.\r\n\r\nFor the `postTextBox` the **at_mention** will show the sections for `Channel Members`, `Special Mentions` and `Not In Channel` and the **channel_mention** will show the sections for `My Channels` and `Other Channels`\r\n\r\nFor the search screen the autocomplete for **at_mentions** will show the `Members` section containing the search term for all the members in the current team, the **channel_mention** autocomplete will show the sections `Public Channels` and `Private Channels`\r\n\r\n#### Ticket Link\r\nhttps://mattermost.atlassian.net/browse/RN-382\r\n\r\n#### Device Information\r\nThis PR was tested on: \r\n* iOS 11 iPhone 6s and Simulator\r\n* Android 7.1 Emulator\r\n* Android 6.0.1 Samsung J5\r\n","created_at":"2017-10-03T15:15:44Z","updated_at":"2017-10-03T17:54:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bd7bf9ba7f6ccb1e751b421a0c9b7e1b31dc949","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jarredwitt","id":5090577,"avatar_url":"https://avatars1.githubusercontent.com/u/5090577?v=4","gravatar_id":"","url":"https://api.github.com/users/jarredwitt","html_url":"https://github.com/jarredwitt","followers_url":"https://api.github.com/users/jarredwitt/followers","following_url":"https://api.github.com/users/jarredwitt/following{/other_user}","gists_url":"https://api.github.com/users/jarredwitt/gists{/gist_id}","starred_url":"https://api.github.com/users/jarredwitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarredwitt/subscriptions","organizations_url":"https://api.github.com/users/jarredwitt/orgs","repos_url":"https://api.github.com/users/jarredwitt/repos","events_url":"https://api.github.com/users/jarredwitt/events{/privacy}","received_events_url":"https://api.github.com/users/jarredwitt/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/mattermost/mattermost-mobile/milestones/3","html_url":"https://github.com/mattermost/mattermost-mobile/milestone/3","labels_url":"https://api.github.com/repos/mattermost/mattermost-mobile/milestones/3/labels","id":2719757,"number":3,"title":"1.3","description":"","creator":{"login":"enahum","id":6757047,"avatar_url":"https://avatars1.githubusercontent.com/u/6757047?v=4","gravatar_id":"","url":"https://api.github.com/users/enahum","html_url":"https://github.com/enahum","followers_url":"https://api.github.com/users/enahum/followers","following_url":"https://api.github.com/users/enahum/following{/other_user}","gists_url":"https://api.github.com/users/enahum/gists{/gist_id}","starred_url":"https://api.github.com/users/enahum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enahum/subscriptions","organizations_url":"https://api.github.com/users/enahum/orgs","repos_url":"https://api.github.com/users/enahum/repos","events_url":"https://api.github.com/users/enahum/events{/privacy}","received_events_url":"https://api.github.com/users/enahum/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":54,"state":"open","created_at":"2017-08-24T00:48:01Z","updated_at":"2017-10-03T15:15:44Z","due_on":"2017-10-05T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/988/commits","review_comments_url":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/988/comments","review_comment_url":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mattermost/mattermost-mobile/issues/988/comments","statuses_url":"https://api.github.com/repos/mattermost/mattermost-mobile/statuses/a0439dd6d7bf6f1c29e3c9b2addb257685e6cc64","head":{"label":"mattermost:RN-382","ref":"RN-382","sha":"a0439dd6d7bf6f1c29e3c9b2addb257685e6cc64","user":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"repo":{"id":70265724,"name":"mattermost-mobile","full_name":"mattermost/mattermost-mobile","owner":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mattermost/mattermost-mobile","description":"Next generation iOS and Android apps for Mattermost in React Native","fork":false,"url":"https://api.github.com/repos/mattermost/mattermost-mobile","forks_url":"https://api.github.com/repos/mattermost/mattermost-mobile/forks","keys_url":"https://api.github.com/repos/mattermost/mattermost-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattermost/mattermost-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattermost/mattermost-mobile/teams","hooks_url":"https://api.github.com/repos/mattermost/mattermost-mobile/hooks","issue_events_url":"https://api.github.com/repos/mattermost/mattermost-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/mattermost/mattermost-mobile/events","assignees_url":"https://api.github.com/repos/mattermost/mattermost-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/mattermost/mattermost-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/mattermost/mattermost-mobile/tags","blobs_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattermost/mattermost-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/mattermost/mattermost-mobile/languages","stargazers_url":"https://api.github.com/repos/mattermost/mattermost-mobile/stargazers","contributors_url":"https://api.github.com/repos/mattermost/mattermost-mobile/contributors","subscribers_url":"https://api.github.com/repos/mattermost/mattermost-mobile/subscribers","subscription_url":"https://api.github.com/repos/mattermost/mattermost-mobile/subscription","commits_url":"https://api.github.com/repos/mattermost/mattermost-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattermost/mattermost-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattermost/mattermost-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattermost/mattermost-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/mattermost/mattermost-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattermost/mattermost-mobile/merges","archive_url":"https://api.github.com/repos/mattermost/mattermost-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattermost/mattermost-mobile/downloads","issues_url":"https://api.github.com/repos/mattermost/mattermost-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/mattermost/mattermost-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/mattermost/mattermost-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattermost/mattermost-mobile/labels{/name}","releases_url":"https://api.github.com/repos/mattermost/mattermost-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/mattermost/mattermost-mobile/deployments","created_at":"2016-10-07T16:52:32Z","updated_at":"2017-10-02T11:59:13Z","pushed_at":"2017-10-03T15:15:45Z","git_url":"git://github.com/mattermost/mattermost-mobile.git","ssh_url":"git@github.com:mattermost/mattermost-mobile.git","clone_url":"https://github.com/mattermost/mattermost-mobile.git","svn_url":"https://github.com/mattermost/mattermost-mobile","homepage":"https://about.mattermost.com/","size":8777,"stargazers_count":235,"watchers_count":235,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":31,"forks":65,"open_issues":31,"watchers":235,"default_branch":"master"}},"base":{"label":"mattermost:release-1.3","ref":"release-1.3","sha":"bed81ad514fa0580ace091d237e5dc0267817c29","user":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"repo":{"id":70265724,"name":"mattermost-mobile","full_name":"mattermost/mattermost-mobile","owner":{"login":"mattermost","id":9828093,"avatar_url":"https://avatars1.githubusercontent.com/u/9828093?v=4","gravatar_id":"","url":"https://api.github.com/users/mattermost","html_url":"https://github.com/mattermost","followers_url":"https://api.github.com/users/mattermost/followers","following_url":"https://api.github.com/users/mattermost/following{/other_user}","gists_url":"https://api.github.com/users/mattermost/gists{/gist_id}","starred_url":"https://api.github.com/users/mattermost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattermost/subscriptions","organizations_url":"https://api.github.com/users/mattermost/orgs","repos_url":"https://api.github.com/users/mattermost/repos","events_url":"https://api.github.com/users/mattermost/events{/privacy}","received_events_url":"https://api.github.com/users/mattermost/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mattermost/mattermost-mobile","description":"Next generation iOS and Android apps for Mattermost in React Native","fork":false,"url":"https://api.github.com/repos/mattermost/mattermost-mobile","forks_url":"https://api.github.com/repos/mattermost/mattermost-mobile/forks","keys_url":"https://api.github.com/repos/mattermost/mattermost-mobile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattermost/mattermost-mobile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattermost/mattermost-mobile/teams","hooks_url":"https://api.github.com/repos/mattermost/mattermost-mobile/hooks","issue_events_url":"https://api.github.com/repos/mattermost/mattermost-mobile/issues/events{/number}","events_url":"https://api.github.com/repos/mattermost/mattermost-mobile/events","assignees_url":"https://api.github.com/repos/mattermost/mattermost-mobile/assignees{/user}","branches_url":"https://api.github.com/repos/mattermost/mattermost-mobile/branches{/branch}","tags_url":"https://api.github.com/repos/mattermost/mattermost-mobile/tags","blobs_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattermost/mattermost-mobile/statuses/{sha}","languages_url":"https://api.github.com/repos/mattermost/mattermost-mobile/languages","stargazers_url":"https://api.github.com/repos/mattermost/mattermost-mobile/stargazers","contributors_url":"https://api.github.com/repos/mattermost/mattermost-mobile/contributors","subscribers_url":"https://api.github.com/repos/mattermost/mattermost-mobile/subscribers","subscription_url":"https://api.github.com/repos/mattermost/mattermost-mobile/subscription","commits_url":"https://api.github.com/repos/mattermost/mattermost-mobile/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattermost/mattermost-mobile/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattermost/mattermost-mobile/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattermost/mattermost-mobile/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattermost/mattermost-mobile/contents/{+path}","compare_url":"https://api.github.com/repos/mattermost/mattermost-mobile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattermost/mattermost-mobile/merges","archive_url":"https://api.github.com/repos/mattermost/mattermost-mobile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattermost/mattermost-mobile/downloads","issues_url":"https://api.github.com/repos/mattermost/mattermost-mobile/issues{/number}","pulls_url":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls{/number}","milestones_url":"https://api.github.com/repos/mattermost/mattermost-mobile/milestones{/number}","notifications_url":"https://api.github.com/repos/mattermost/mattermost-mobile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattermost/mattermost-mobile/labels{/name}","releases_url":"https://api.github.com/repos/mattermost/mattermost-mobile/releases{/id}","deployments_url":"https://api.github.com/repos/mattermost/mattermost-mobile/deployments","created_at":"2016-10-07T16:52:32Z","updated_at":"2017-10-02T11:59:13Z","pushed_at":"2017-10-03T15:15:45Z","git_url":"git://github.com/mattermost/mattermost-mobile.git","ssh_url":"git@github.com:mattermost/mattermost-mobile.git","clone_url":"https://github.com/mattermost/mattermost-mobile.git","svn_url":"https://github.com/mattermost/mattermost-mobile","homepage":"https://about.mattermost.com/","size":8777,"stargazers_count":235,"watchers_count":235,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":31,"forks":65,"open_issues":31,"watchers":235,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/988"},"html":{"href":"https://github.com/mattermost/mattermost-mobile/pull/988"},"issue":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/issues/988"},"comments":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/issues/988/comments"},"review_comments":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/988/comments"},"review_comment":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/pulls/988/commits"},"statuses":{"href":"https://api.github.com/repos/mattermost/mattermost-mobile/statuses/a0439dd6d7bf6f1c29e3c9b2addb257685e6cc64"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"hmhealey"}}