1 parent 13e8543 commit f16ad68Copy full SHA for f16ad68
1 file changed
frontend/common/stores/account-store.js
@@ -350,6 +350,16 @@ const controller = {
350
API.setCookie('organisation', `${id}`)
351
store.organisation = find(store.model.organisations, { id })
352
getStore().dispatch(setSelectedOrganisationId(id))
353
+ // Keep the org-scoped traits pointing at the organisation on screen, so
354
+ // org-scoped segments are evaluated against it. setTraits rather than
355
+ // identify: the identity is unchanged, so bucketing is undisturbed.
356
+ flagsmith
357
+ .setTraits({
358
+ 'organisation.id': String(id),
359
+ 'organisation.name': store.organisation?.name ?? '',
360
+ 'subscription.plan': store.organisation?.subscription?.plan ?? '',
361
+ })
362
+ .catch(() => {})
363
store.changed()
364
identifyChatUser()
365
},
0 commit comments