Skip to content

Commit fcc805f

Browse files
committed
update
1 parent efb1f7d commit fcc805f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ const stateSelector = [
291291
'[class^="StateLabel"]',
292292
].join(',');
293293

294-
export const isDraftPR = (): boolean => isPR() && $(stateSelector)!.textContent!.trim() === 'Draft';
294+
export const isDraftPR = (): boolean => $(stateSelector)?.textContent!.trim() === 'Draft';
295295
export const isOpenPR = (): boolean => {
296296
if (!isPR()) {
297297
return false;
@@ -302,11 +302,7 @@ export const isOpenPR = (): boolean => {
302302
};
303303

304304
export const isMergedPR = (): boolean => {
305-
if (!isPR()) {
306-
return false;
307-
}
308-
309-
const status = $(stateSelector)!.textContent!.trim();
305+
const status = $(stateSelector)?.textContent!.trim();
310306
return status === 'Merged';
311307
};
312308

0 commit comments

Comments
 (0)