summaryrefslogtreecommitdiff
path: root/source/features/quick-pr-diff-options.tsx
diff options
context:
space:
mode:
authorGravatar Florent <cheap.glitch@gmail.com> 2021-11-30 18:08:35 +0100
committerGravatar GitHub <noreply@github.com> 2021-11-30 18:08:35 +0100
commitdcc79879c2fab648ba87494dc3728d7005f756a6 (patch)
tree5e3a6a0b6b330d0e2643b2647e3626e7cfb728cd /source/features/quick-pr-diff-options.tsx
parentafd2794e2645877a49efdc6251d58c18ea341311 (diff)
downloadrefined-github-dcc79879c2fab648ba87494dc3728d7005f756a6.tar.gz
refined-github-dcc79879c2fab648ba87494dc3728d7005f756a6.tar.zst
refined-github-dcc79879c2fab648ba87494dc3728d7005f756a6.zip
Fix `quick-pr-diff-options` on GHE (#5127)
Co-authored-by: Scott Busche <swbusche@gmail.com>
Diffstat (limited to 'source/features/quick-pr-diff-options.tsx')
-rw-r--r--source/features/quick-pr-diff-options.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/features/quick-pr-diff-options.tsx b/source/features/quick-pr-diff-options.tsx
index 81d2864f..9f6cbc46 100644
--- a/source/features/quick-pr-diff-options.tsx
+++ b/source/features/quick-pr-diff-options.tsx
@@ -74,10 +74,11 @@ function createWhitespaceButton(): HTMLElement {
}
function initPR(): false | void {
- // TODO [2022-05-01]: Remove `.js-diff-settings` from the selector (kept for GHE)
- const originalToggle = select('.js-diff-settings, [aria-label="Diff settings"]')!.closest('details')!.parentElement!;
+ const originalToggle = pageDetect.isEnterprise()
+ ? select('.js-diff-settings')!.closest('details')! // TODO [2022-05-01]: Remove GHE code
+ : select('[aria-label="Diff settings"]')!.closest('details')!.parentElement!;
- if (!isHidingWhitespace()) {
+ if (!isHidingWhitespace() || pageDetect.isEnterprise()) {
originalToggle.after(
<div className="diffbar-item d-flex">{createWhitespaceButton()}</div>,
);