@samitouri / QOS-React-2 / commits / c1a53ad2b2

DevTools pre-filter GH issues by repo (#21292)

Brian Vaughn committed Apr 15, 2021 at 19:56 UTC c1a53ad2b2f29f30412c682b42bdd6ac3227eafa
1 file changed +5 -9
packages/react-devtools-shared/src/devtools/views/ErrorBoundary/githubAPI.js
+5 -9
@@ -21,13 +21,12 @@ export async function searchGitHubIssues(
21 message = message.replace(/"[0-9]+"/, '');
22
23 const filters = [
24 - // Unfortunately "repo" and "org" filters don't work
25 - // Hopefully the label filter will be sufficient.
24 'in:title',
25 'is:issue',
26 'is:open',
27 'is:public',
28 'label:"Component: Developer Tools"',
29 + 'repo:facebook/react',
30 ];
31
32 const octokit = new Octokit();
@@ -35,14 +34,11 @@ export async function searchGitHubIssues(
34 q: message + ' ' + filters.join(' '),
35 });
36
38 - const maybeItem = data.items.find(item =>
39 - item.html_url.startsWith('https://github.com/facebook/react/'),
40 - );
41 -
42 - if (maybeItem) {
37 + if (data.items.length > 0) {
38 + const item = data.items[0];
39 return {
44 - title: maybeItem.title,
45 - url: maybeItem.html_url,
40 + title: item.title,
41 + url: item.html_url,
42 };
43 } else {
44 return null;