Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kovsu committed Nov 6, 2024
1 parent efb1f7d commit fcc805f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ const stateSelector = [
'[class^="StateLabel"]',
].join(',');

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

export const isMergedPR = (): boolean => {
if (!isPR()) {
return false;
}

const status = $(stateSelector)!.textContent!.trim();
const status = $(stateSelector)?.textContent!.trim();
return status === 'Merged';
};

Expand Down

0 comments on commit fcc805f

Please sign in to comment.