summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/features/use-first-commit-message-for-new-prs.tsx10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/features/use-first-commit-message-for-new-prs.tsx b/source/features/use-first-commit-message-for-new-prs.tsx
index 408733de..ea04f0c5 100644
--- a/source/features/use-first-commit-message-for-new-prs.tsx
+++ b/source/features/use-first-commit-message-for-new-prs.tsx
@@ -7,16 +7,12 @@ import features from '.';
import looseParseInt from '../helpers/loose-parse-int';
async function init(): Promise<void | false> {
- const commitCount = await elementReady<HTMLElement>([
- '.overall-summary > ul > li:nth-child(1) .text-emphasized', // Cross fork
- '[href="#commits_bucket"] .Counter' // Same repository
- ].join());
-
- if (!commitCount || looseParseInt(commitCount.textContent!) < 2 || !select.exists('#new_pull_request')) {
+ const commitCount = (await elementReady<HTMLElement>('div.Box.mb-3 .octicon-git-commit'))?.nextElementSibling;
+ if (!commitCount || looseParseInt(commitCount) < 2 || !select.exists('#new_pull_request')) {
return false;
}
- const [prTitle, ...prMessage] = select('#commits_bucket .commit-message code a')!.title.split(/\n\n/);
+ const [prTitle, ...prMessage] = select('#commits_bucket [data-url$="compare/commit"] a[title]')!.title.split(/\n\n/);
textFieldEdit.set(
select<HTMLInputElement>('.discussion-topic-header input')!,