@@ -33,7 +33,7 @@ function SearchContext({ repository }: SearchContextProps) {
33
33
const [ firstLoad , setfirstLoad ] = useState ( true ) ;
34
34
35
35
const { data, isLoading : isPRLoading } = usePromise (
36
- async ( searchText ) => {
36
+ async ( searchText , sections ) => {
37
37
const result : {
38
38
pullRequest ?: PullRequestFieldsFragment [ ] | undefined ;
39
39
issues ?: IssueFieldsFragment [ ] | undefined ;
@@ -50,9 +50,8 @@ function SearchContext({ repository }: SearchContextProps) {
50
50
if ( sections . includes ( "/p" ) ) {
51
51
const pullRequest = (
52
52
await github . searchPullRequests ( {
53
- query : `is:pr repo:${ repository . nameWithOwner } ${
54
- forAuthor ? "author:@me" : ""
55
- } archived:false ${ searchText . trim ( ) } `,
53
+ query : `is:pr repo:${ repository . nameWithOwner } ${ forAuthor ? "author:@me" : ""
54
+ } archived:false ${ searchText . trim ( ) } `,
56
55
numberOfItems : n ,
57
56
} )
58
57
) . search . edges ?. map ( ( edge ) => edge ?. node as PullRequestFieldsFragment ) ;
@@ -62,9 +61,8 @@ function SearchContext({ repository }: SearchContextProps) {
62
61
if ( sections . includes ( "/i" ) ) {
63
62
const issues = (
64
63
await github . searchIssues ( {
65
- query : `is:issue repo:${ repository . nameWithOwner } ${
66
- forAuthor ? "author:@me" : ""
67
- } archived:false ${ searchText . trim ( ) } `,
64
+ query : `is:issue repo:${ repository . nameWithOwner } ${ forAuthor ? "author:@me" : ""
65
+ } archived:false ${ searchText . trim ( ) } `,
68
66
numberOfItems : n ,
69
67
} )
70
68
) . search . nodes ?. map ( ( node ) => node as IssueFieldsFragment ) ;
@@ -90,7 +88,7 @@ function SearchContext({ repository }: SearchContextProps) {
90
88
91
89
return result ;
92
90
} ,
93
- [ searchText ] ,
91
+ [ searchText , sections ] ,
94
92
{
95
93
onError ( error ) {
96
94
showToast ( {
0 commit comments