From 63d576a27641c4ae74704a1724377857db7a7765 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Tue, 11 May 2021 16:16:58 +0200 Subject: [PATCH] Fix empty /personalization due to personalizationLogic error (#4287) --- .../src/scenes/onboarding/personalizationLogic.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/src/scenes/onboarding/personalizationLogic.ts b/frontend/src/scenes/onboarding/personalizationLogic.ts index 267330526d4..52a57780454 100644 --- a/frontend/src/scenes/onboarding/personalizationLogic.ts +++ b/frontend/src/scenes/onboarding/personalizationLogic.ts @@ -6,6 +6,9 @@ import { PersonalizationData } from '~/types' import { router } from 'kea-router' export const personalizationLogic = kea>({ + connect: { + actions: [organizationLogic, ['updateOrganizationSuccess', 'loadCurrentOrganizationSuccess']], + }, actions: { setPersonalizationData: (payload: PersonalizationData) => ({ payload }), appendPersonalizationData: (key: 'role' | 'products' | 'technical', value: string | string[] | null) => ({ @@ -28,10 +31,10 @@ export const personalizationLogic = kea { + reportPersonalizationSkipped: () => { posthog.capture('personalization skipped') }, - reportPersonalization: async ({ payload, step_completed_fully }) => { + reportPersonalization: ({ payload, step_completed_fully }) => { posthog.people.set_once(payload) posthog.capture('personalization finalized', { step_completed_fully, @@ -40,10 +43,10 @@ export const personalizationLogic = kea { + [organizationLogic.actionTypes.updateOrganizationSuccess]: () => { window.location.href = '/' }, - [organizationLogic.actionTypes.loadCurrentOrganizationSuccess]: async () => { + [organizationLogic.actionTypes.loadCurrentOrganizationSuccess]: () => { // Edge case in case this logic loaded before the api/organization request is completed const personalization = organizationLogic.values.currentOrganization?.personalization if (personalization && Object.keys(personalization).length) {