File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -286,15 +286,19 @@ TEST: addTests('isQuickPR', [
286286 'https://github.com/sindresorhus/refined-github/compare/test-branch?quick_pull=1' ,
287287] ) ;
288288
289- export const isDraftPR = ( ) : boolean => exists ( '#partial-discussion-header .octicon-git-pull-request-draft' ) ;
290- export const isOpenPR = ( ) : boolean => exists ( '#partial-discussion-header :is(.octicon-git-pull-request, .octicon-git-pull-request-draft)' ) ;
289+ export const isDraftPR = ( ) : boolean => ( $ ( '.State' ) ?? $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) === 'Draft' ;
290+ export const isOpenPR = ( ) : boolean => {
291+ const status = ( $ ( '.State' ) ?? $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) ;
292+ return status === 'Open' || status === 'Draft' ;
293+ } ;
294+
291295export const isMergedPR = ( ) : boolean => {
292- const status = ( $ ( '.State' ) || $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) ;
296+ const status = ( $ ( '.State' ) ?? $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) ;
293297 return status === 'Merged' ;
294298} ;
295299
296300export const isClosedPR = ( ) : boolean => {
297- const status = ( $ ( '.State' ) || $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) ;
301+ const status = ( $ ( '.State' ) ?? $ ( '[class^="StateLabel"]' ) ) ! . textContent ! . trim ( ) ;
298302 return status === 'Closed' || status === 'Merged' ;
299303} ;
300304
You can’t perform that action at this time.
0 commit comments