From 17d55029b7224038a2daaecf524ce5ec9f5c9ef6 Mon Sep 17 00:00:00 2001 From: Vedant K Date: Sun, 26 Sep 2021 10:38:53 +0530 Subject: Meta: Add an `asLongAs` option to `features.add()` (#4800) Co-authored-by: yakov116 <16872793+yakov116@users.noreply.github.com> Co-authored-by: Federico Brigante --- source/features/enable-file-links-in-compare-view.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/features/enable-file-links-in-compare-view.tsx') diff --git a/source/features/enable-file-links-in-compare-view.tsx b/source/features/enable-file-links-in-compare-view.tsx index a81d2126..85df3a7a 100644 --- a/source/features/enable-file-links-in-compare-view.tsx +++ b/source/features/enable-file-links-in-compare-view.tsx @@ -68,12 +68,12 @@ void features.add(__filebasename, { ], init, }, { + asLongAs: [ + // Only enable if you can create a PR or view an existing PR, if you can't you are probably looking at a permalink. + () => select.exists('.existing-pull-button, [data-ga-click*="text:Create pull request"]'), + ], include: [ pageDetect.isCompare, ], - exclude: [ - // Only enable if you can create a PR or view an existing PR, if you cant you are probably looking at a permalink. - () => !select.exists('.existing-pull-button, [data-ga-click*="text:Create pull request"]'), - ], init, }); -- cgit v1.2.3