Skip to content

Commit

Permalink
[core] Swallow ad blocker fetch fail (#33617)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Jul 25, 2022
1 parent ad4cdac commit 03dc394
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/src/modules/components/AdCarbon.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ export function AdCarbonInline(props) {
}

attempt += 1;
const response = await fetch('https://srv.buysellads.com/ads/CE7DC23W.json');
let response;
try {
response = await fetch('https://srv.buysellads.com/ads/CE7DC23W.json');
} catch (err) {
// Ad blocker crashes this request
return null;
}

const data = await response.json();
// Inspired by https://github.com/Semantic-Org/Semantic-UI-React/blob/2c7134128925dd831de85011e3eb0ec382ba7f73/docs/src/components/CarbonAd/CarbonAdNative.js#L9
const sanitizedAd = data.ads
Expand Down

0 comments on commit 03dc394

Please sign in to comment.