@playpilot/tpi 8.5.9 → 8.5.10-beta.2

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.5.9",
3
+ "version": "8.5.10-beta.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
package/src/main.ts CHANGED
@@ -6,7 +6,7 @@ import { isCrawler } from '$lib/crawler'
6
6
  import { getPageTextAndElements } from '$lib/injectionElements'
7
7
  import { isUrlExcludedViaConfig } from '$lib/url'
8
8
 
9
- window.PlayPilotLinkInjections = {
9
+ window.PlayPilotLinkInjections ||= {
10
10
  token: '',
11
11
  editorial_token: '',
12
12
  selector: '',
@@ -79,6 +79,8 @@ window.PlayPilotLinkInjections = {
79
79
 
80
80
  destroy(): void {
81
81
  window.PlayPilotMount?.destroy()
82
+ // @ts-ignore
83
+ delete window.PlayPilotLinkInjections
82
84
  },
83
85
 
84
86
  mount(): void {
package/src/mount.ts CHANGED
@@ -4,7 +4,7 @@ import { clearLinkInjections } from '$lib/injection'
4
4
 
5
5
  window.PlayPilotMount = {
6
6
  mount(): void {
7
- if (window.PlayPilotLinkInjections.app) this.destroy()
7
+ if (window.PlayPilotLinkInjections.app) return
8
8
 
9
9
  const target = document.createElement('div')
10
10
  target.id = 'playpilot-link-injection'
@@ -32,6 +32,7 @@
32
32
 
33
33
  onMount(async () => {
34
34
  track(TrackingEvent.ExplorePageView)
35
+ console.log('track page view')
35
36
 
36
37
  if (!window.PlayPilotLinkInjections.ads?.length) window.PlayPilotLinkInjections.ads = await fetchAds()
37
38
  })