Skip to content

Commit 6aca990

Browse files
committed
update
1 parent 9d23801 commit 6aca990

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

index.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,20 +289,12 @@ TEST: addTests('isQuickPR', [
289289
export const isDraftPR = (): boolean => exists('#partial-discussion-header .octicon-git-pull-request-draft');
290290
export const isOpenPR = (): boolean => exists('#partial-discussion-header :is(.octicon-git-pull-request, .octicon-git-pull-request-draft)');
291291
export const isMergedPR = (): boolean => {
292-
if (exists('#partial-discussion-header :is(.octicon-git-merge)')) {
293-
return true;
294-
}
295-
296-
const status = $('[class^="StateLabel"]')!.textContent;
292+
const status = ($('.State') || $('[class^="StateLabel"]'))!.textContent!.trim();
297293
return status === 'Merged';
298294
};
299295

300296
export const isClosedPR = (): boolean => {
301-
if (exists('#partial-discussion-header :is(.octicon-git-pull-request-closed, .octicon-git-merge)')) {
302-
return true;
303-
}
304-
305-
const status = $('[class^="StateLabel"]')!.textContent;
297+
const status = ($('.State') || $('[class^="StateLabel"]'))!.textContent!.trim();
306298
return status === 'Closed' || status === 'Merged';
307299
};
308300

0 commit comments

Comments
 (0)