diff options
author | 2019-08-22 12:48:30 -0500 | |
---|---|---|
committer | 2019-08-22 12:48:30 -0500 | |
commit | 430fb5ca201b972253fe2b2d95c44d83431e2956 (patch) | |
tree | 182918f0c0d922121f6b3fb7f9841e7e8f2ee60d | |
parent | 9bf310a9ae295ff168e11aeeea7eaf1aba0fa1de (diff) | |
download | refined-github-430fb5ca201b972253fe2b2d95c44d83431e2956.tar.gz refined-github-430fb5ca201b972253fe2b2d95c44d83431e2956.tar.zst refined-github-430fb5ca201b972253fe2b2d95c44d83431e2956.zip |
fix: marketplace is opt-in for Enterprise, handle it being turned off (#2353)19.8.23
* fix: marketplace is opt-in for Enterprise, handle it being turned off
Marketplace is an opt-in feature for GHE, if you're on an instance where it's not enabled, `marketPlaceLink` will be undefined and return an error in the console when `.closest` is invoked.
* drop unnecessary !
-rw-r--r-- | source/features/deprioritize-marketplace-link.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/features/deprioritize-marketplace-link.tsx b/source/features/deprioritize-marketplace-link.tsx index 70c3aae3..9f9ae8dd 100644 --- a/source/features/deprioritize-marketplace-link.tsx +++ b/source/features/deprioritize-marketplace-link.tsx @@ -5,9 +5,11 @@ import domLoaded from 'dom-loaded'; import features from '../libs/features'; async function init(): Promise<void> { - (await elementReady('.Header-link[href="/marketplace"]'))! + const marketPlaceLink = (await elementReady('.Header-link[href="/marketplace"]')); + if (marketPlaceLink) { // The Marketplace link seems to have an additional wrapper that other links don't have https://i.imgur.com/KV9rtSq.png - .closest('.border-top, .mr-3')!.remove(); + marketPlaceLink.closest('.border-top, .mr-3')!.remove(); + } await domLoaded; |