Skip to content

feat: set response properties from the server #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -682,4 +682,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 329483eb6daf495a1eab8db2c188f13aaa25dcf9

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
4 changes: 4 additions & 0 deletions src/iterate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ class Iterate {
// the correct event traits with it
const responseId = new Date().getTime();

if (response.event_traits != null) {
eventTraits = { ...(eventTraits ?? {}), ...response.event_traits };
}

if (eventTraits != null) {
store.dispatch(setEventTraits(eventTraits, responseId));
}
Expand Down
1 change: 1 addition & 0 deletions src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export type ApiResponse<ResultsType> = {

export type EmbedResults = {
auth?: Auth;
event_traits?: EventTraits;
survey?: Survey;
triggers?: Trigger[];
tracking?: Tracking;
Expand Down
Loading