Skip to content

Commit

Permalink
Don't try to get window.top
Browse files Browse the repository at this point in the history
  • Loading branch information
msub2 committed Jan 24, 2024
1 parent de563d1 commit b7920e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/networking.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const DB_ENDPOINT = 'https://api.zesty.market/api';

const fetchCampaignAd = async (adUnitId, format = 'tall', style = 'standard') => {
try {
const url = encodeURI(window.top.location.href).replace(/\/$/, ''); // If URL ends with a slash, remove it
const url = encodeURI(window.location.href).replace(/\/$/, ''); // If URL ends with a slash, remove it
const res = await axios.get(`${DB_ENDPOINT}/ad?ad_unit_id=${adUnitId}&url=${url}`);
if (res.data)
return res.data;
Expand Down

0 comments on commit b7920e6

Please sign in to comment.