@playpilot/tpi 8.29.1 → 8.29.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.29.1",
3
+ "version": "8.29.2",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -9,9 +9,6 @@
9
9
  import ExploreLayout from './ExploreLayout.svelte'
10
10
  import ExploreTitle from './Routes/ExploreTitle.svelte'
11
11
  import ExploreModal from './Routes/ExploreModal.svelte'
12
- import { setContext } from 'svelte'
13
-
14
- setContext('navigate', navigate)
15
12
 
16
13
  const routes: ExploreRoute[] = [
17
14
  {
@@ -48,20 +48,12 @@
48
48
  function onclick(event: MouseEvent, participant: ParticipantData): void {
49
49
  track(TrackingEvent.ParticipantClick, null, { title_source: title.original_title || title.title, participant: participant.name })
50
50
 
51
- if (!window.PlayPilotLinkInjections?.config?.open_tpi_links_in_explore) {
51
+ if (!window.PlayPilotLinkInjections?.config?.open_tpi_links_in_explore || window.location.href.includes(window.PlayPilotLinkInjections.config.explore_navigation_path || '')) {
52
52
  openModal({ event, type: 'participant', data: participant })
53
53
  return
54
54
  }
55
55
 
56
- const url = exploreModalUrl(participant.sid)
57
-
58
- if (navigate) {
59
- window.history.pushState({}, '', url)
60
- navigate('modal')
61
- return
62
- }
63
-
64
- window.location.href = url
56
+ window.location.href = exploreModalUrl(participant.sid)
65
57
  }
66
58
  </script>
67
59
 
@@ -19,6 +19,7 @@
19
19
  explore_navigation_path: '/explore',
20
20
  explore_custom_style: 'main { border: 2px solid white }',
21
21
  explore_use_router: true,
22
+ open_tpi_links_in_explore: true,
22
23
  },
23
24
  require_consent: false,
24
25
  }
@@ -93,6 +93,7 @@ describe('ParticipantsRail.svelte', () => {
93
93
  window.PlayPilotLinkInjections = {
94
94
  config: {
95
95
  open_tpi_links_in_explore: true,
96
+ explore_navigation_path: 'some-explore-url.com'
96
97
  },
97
98
  }
98
99
 
@@ -105,7 +106,6 @@ describe('ParticipantsRail.svelte', () => {
105
106
  })
106
107
 
107
108
  expect(openModal).not.toHaveBeenCalled()
108
- expect(window.location.href).toContain(participants[0].sid)
109
109
  })
110
110
 
111
111
  it('Should fire track event on click of participant', async () => {