@playpilot/tpi 8.29.6-beta.4 → 8.29.6-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.29.6-beta.4",
3
+ "version": "8.29.6-beta.5",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -55,9 +55,6 @@
55
55
  fireQueuedTrackingEvents()
56
56
  track(TrackingEvent.ArticlePageView)
57
57
 
58
- if (!aiInjections.length && !manualInjections.length) return
59
- if (window.PlayPilotLinkInjections.no_affiliate) return
60
-
61
58
  window.PlayPilotLinkInjections.ads = await fetchAds()
62
59
  }
63
60
 
@@ -14,8 +14,6 @@
14
14
  listenForConsent()
15
15
 
16
16
  function listenForConsent(): void {
17
- // If require_consent has been explicitely turned off we return right away and call `onchange`.
18
- // We don't need to set consent values as require_consent=false will mean all consent is true.
19
17
  if (window.PlayPilotLinkInjections.require_consent === false) {
20
18
  update()
21
19
  return
@@ -19,13 +19,13 @@
19
19
 
20
20
  const { items, initialIndex = 0, onchange = () => null, onclose = () => null, each, ...restProps }: Props = $props()
21
21
 
22
- const displayAd = getFirstAdOfType('card')
23
22
  const transitionDuration = 300
24
23
 
25
24
  let slider: TinySlider
26
25
  let initialized = $state(false)
27
26
  let availableHeight: number | null = $state(null)
28
27
  let element: HTMLElement | null = $state(null)
28
+ let displayAd = $state(getFirstAdOfType('card'))
29
29
 
30
30
  onMount(() => {
31
31
  setAvailableHeight()
@@ -57,7 +57,7 @@
57
57
  }
58
58
  </script>
59
59
 
60
- <svelte:window onresize={setAvailableHeight} />
60
+ <svelte:window onresize={setAvailableHeight} onupdateconsent={() => displayAd = getFirstAdOfType('card')} />
61
61
 
62
62
  {#snippet prepend()}
63
63
  {#if displayAd}
@@ -24,11 +24,11 @@
24
24
 
25
25
  const { titles, onclose = () => null }: Props = $props()
26
26
 
27
- const displayAd = getFirstAdOfType('card')
28
27
 
29
28
  let interval: ReturnType<typeof setInterval> | null = null
30
29
  let availableHeight: number = $state(window.innerHeight)
31
30
  let element: HTMLElement | null = $state(null)
31
+ let displayAd = $state(getFirstAdOfType('card'))
32
32
 
33
33
  onMount(() => {
34
34
  pauseAndPlay(0)
@@ -65,7 +65,7 @@
65
65
  }
66
66
  </script>
67
67
 
68
- <svelte:window onresize={setAvailableHeight} />
68
+ <svelte:window onresize={setAvailableHeight} onupdateconsent={() => displayAd = getFirstAdOfType('card')} />
69
69
 
70
70
  {#snippet prepend()}
71
71
  {#if displayAd}