Skip to content

Commit

Permalink
Merge pull request #213 from zestyxyz/update-refresh-interval
Browse files Browse the repository at this point in the history
Export AD_REFRESH_INTERVAL from networking and lower to 15 seconds
  • Loading branch information
msub2 authored Jun 10, 2024
2 parents c98836a + fa08f85 commit 381bc0b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions aframe/src/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/* global AFRAME */

import { fetchCampaignAd, sendOnLoadMetric, sendOnClickMetric, analyticsSession } from '../../utils/networking';
import { fetchCampaignAd, sendOnLoadMetric, sendOnClickMetric, analyticsSession, AD_REFRESH_INTERVAL } from '../../utils/networking';
import { formats, defaultFormat, defaultStyle } from '../../utils/formats';
import { openURL } from '../../utils/helpers';
import { version } from '../package.json';
import { getV3BetaUnitInfo } from '../../utils/networking';

console.log('Zesty SDK Version: ', version);

const AD_REFRESH_INTERVAL = 30000; // 30 seconds

function getCameraHelper(callback) {
const camera = document.querySelector('[camera]');
if (camera && camera.components && camera.components.camera && camera.components.camera.camera) {
Expand Down
3 changes: 2 additions & 1 deletion utils/networking.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const DB_ENDPOINT = 'https://api.zesty.market/api';
//const sessionId = uuidv4();

// Prebid variables
const AD_REFRESH_INTERVAL = 15000;
let prebidInit = false;
let interval = null;
const retryCount = 10;
Expand Down Expand Up @@ -172,4 +173,4 @@ const analyticsSession = async (spaceId, campaignId) => {
}
}

export { fetchCampaignAd, sendOnLoadMetric, sendOnClickMetric, analyticsSession, getV3BetaUnitInfo };
export { fetchCampaignAd, sendOnLoadMetric, sendOnClickMetric, analyticsSession, getV3BetaUnitInfo, AD_REFRESH_INTERVAL };
3 changes: 1 addition & 2 deletions wonderland/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global WL */

import { fetchCampaignAd, sendOnLoadMetric, sendOnClickMetric, getV3BetaUnitInfo } from '../../utils/networking';
import { fetchCampaignAd, sendOnLoadMetric, sendOnClickMetric, getV3BetaUnitInfo, AD_REFRESH_INTERVAL } from '../../utils/networking';
import { formats, defaultFormat } from '../../utils/formats';
import { openURL } from '../../utils/helpers';
import { version } from '../package.json';
Expand All @@ -18,7 +18,6 @@ console.log('Zesty SDK Version: ', version);

const formatsLink = 'https://cdn.zesty.xyz/sdk/zesty-formats.js';
const networkingLink = 'https://cdn.zesty.xyz/sdk/zesty-networking.js';
const AD_REFRESH_INTERVAL = 30000; // 30 seconds

/**
* [Zesty Market](https://zesty.xyz) banner ad unit
Expand Down

0 comments on commit 381bc0b

Please sign in to comment.