File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -288,8 +288,19 @@ TEST: addTests('isQuickPR', [
288288
289289export const isDraftPR = ( ) : boolean => exists ( '#partial-discussion-header .octicon-git-pull-request-draft' ) ;
290290export const isOpenPR = ( ) : boolean => exists ( '#partial-discussion-header :is(.octicon-git-pull-request, .octicon-git-pull-request-draft)' ) ;
291- export const isMergedPR = ( ) : boolean => exists ( '#partial-discussion-header .octicon-git-merge' ) ;
292- export const isClosedPR = ( ) : boolean => exists ( '#partial-discussion-header :is(.octicon-git-pull-request-closed, .octicon-git-merge)' ) ;
291+ export const isMergedPR = ( ) : boolean => {
292+ if ( exists ( '#partial-discussion-header :is(.octicon-git-merge)' ) )
293+ return true ;
294+ const status = $ ( '[class^="StateLabel"]' ) ! . textContent
295+ return status === 'Merged'
296+ }
297+ export const isClosedPR = ( ) : boolean => {
298+ if ( exists ( '#partial-discussion-header :is(.octicon-git-pull-request-closed, .octicon-git-merge)' ) )
299+ return true ;
300+ const status = $ ( '[class^="StateLabel"]' ) ! . textContent
301+ return status === 'Closed' || status === 'Merged'
302+ }
303+
293304export const isClosedIssue = ( ) : boolean => exists ( '#partial-discussion-header :is(.octicon-issue-closed, .octicon-skip)' ) ;
294305
295306export const isReleases = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === 'releases' ;
You can’t perform that action at this time.
0 commit comments