From e97543a1511b45b5ac0466d24503c0ae9507d12b Mon Sep 17 00:00:00 2001 From: Marius Andra Date: Mon, 2 Dec 2024 15:20:34 +0100 Subject: [PATCH 1/2] fix: use previous site-app variables --- src/site-apps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site-apps.ts b/src/site-apps.ts index 73414ace1..9bb507e34 100644 --- a/src/site-apps.ts +++ b/src/site-apps.ts @@ -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) From b41ae0abb6641f67d167e2eb1db4e0175f698720 Mon Sep 17 00:00:00 2001 From: Marius Andra Date: Mon, 2 Dec 2024 15:25:37 +0100 Subject: [PATCH 2/2] test --- src/__tests__/site-apps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/__tests__/site-apps.ts b/src/__tests__/site-apps.ts index 6c670eeb4..7964a7e17 100644 --- a/src/__tests__/site-apps.ts +++ b/src/__tests__/site-apps.ts @@ -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(