Skip to content

Commit

Permalink
fix: use previous site-app variables (#1574)
Browse files Browse the repository at this point in the history
* fix: use previous site-app variables

* test
  • Loading branch information
mariusandra authored Dec 2, 2024
1 parent d586455 commit e2689c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/site-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ describe('SiteApps', () => {

siteAppsInstance.afterDecideResponse(response)

expect(assignableWindow['__$$ph_site_app_1_posthog']).toBe(posthog)
expect(assignableWindow['__$$ph_site_app_1']).toBe(posthog)
expect(typeof assignableWindow['__$$ph_site_app_1_missed_invocations']).toBe('function')
expect(typeof assignableWindow['__$$ph_site_app_1_callback']).toBe('function')
expect(assignableWindow.__PosthogExtensions__?.loadSiteApp).toHaveBeenCalledWith(
Expand Down
2 changes: 1 addition & 1 deletion src/site-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class SiteApps {
for (const { id, url } of response['siteApps']) {
// TODO: if we have opted out and "type" is "site_destination", ignore it... but do include "site_app" types
this.appsLoading.add(id)
assignableWindow[`__$$ph_site_app_${id}_posthog`] = this.instance
assignableWindow[`__$$ph_site_app_${id}`] = this.instance
assignableWindow[`__$$ph_site_app_${id}_missed_invocations`] = () => this.missedInvocations
assignableWindow[`__$$ph_site_app_${id}_callback`] = () => {
this.appsLoading.delete(id)
Expand Down

0 comments on commit e2689c0

Please sign in to comment.