summaryrefslogtreecommitdiff
path: root/source/features/use-first-commit-message-for-new-prs.tsx
diff options
context:
space:
mode:
authorGravatar yakov116 <16872793+yakov116@users.noreply.github.com> 2020-11-17 00:41:28 -0500
committerGravatar GitHub <noreply@github.com> 2020-11-17 00:41:28 -0500
commit48bb7fee3d42575a223274e467102598b154ad0a (patch)
treea10c35c51c1d0bca59c890415dfdebbb1d5a83ef /source/features/use-first-commit-message-for-new-prs.tsx
parent38fb7b001222421c6e3d3e17bfddb3d373a37739 (diff)
downloadrefined-github-48bb7fee3d42575a223274e467102598b154ad0a.tar.gz
refined-github-48bb7fee3d42575a223274e467102598b154ad0a.tar.zst
refined-github-48bb7fee3d42575a223274e467102598b154ad0a.zip
Fix `first-commit-message-for-new-prs` (#3722)
Co-authored-by: Fregante <opensource@bfred.it>
Diffstat (limited to 'source/features/use-first-commit-message-for-new-prs.tsx')
-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')!,