Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions source/features/clean-conversation-headers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'dom-chef';
import elementReady from 'element-ready';
import * as pageDetect from 'github-url-detection';
import ArrowLeftIcon from 'octicons-plain-react/ArrowLeft';
import {$, closestElementOptional} from 'select-dom';
import {$, closestElement, closestElementOptional} from 'select-dom';

import features from '../feature-manager.js';
import getDefaultBranch from '../github-helpers/get-default-branch.js';
Expand Down Expand Up @@ -90,7 +90,8 @@ function replaceFromWithArrow(base: HTMLElement): void {
);
}

async function cleanPrHeader(summaryRow: HTMLElement): Promise<void> {
async function cleanPrHeader(headRef: HTMLElement): Promise<void> {
const summaryRow = closestElement('.d-flex[class*="PullRequestHeaderSummary"]', headRef);
summaryRow.classList.add('rgh-clean-conversation-headers');

if (isStickyHeader(summaryRow)) {
Expand Down Expand Up @@ -122,7 +123,7 @@ async function cleanPrHeader(summaryRow: HTMLElement): Promise<void> {

async function init(signal: AbortSignal): Promise<void> {
observe(
'.d-flex[class*="PullRequestHeaderSummary"]',
'[class^="PullRequestBranchName"] ~ div [class^="PullRequestBranchName"]',
cleanPrHeader,
{signal},
);
Expand Down
Loading