Skip to content
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

fix RegisterOnce not really register once #162

Merged
merged 1 commit into from
Sep 20, 2023
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
1 change: 0 additions & 1 deletion Mixpanel/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ internal static void DoTrack(string eventName, Value properties)
properties["$screen_width"] = Screen.width;
properties["$screen_height"] = Screen.height;
properties.Merge(MixpanelStorage.OnceProperties);
MixpanelStorage.ResetOnceProperties();
properties.Merge(MixpanelStorage.SuperProperties);
Value startTime;
if (MixpanelStorage.TimedEvents.TryGetValue(eventName, out startTime))
Expand Down
6 changes: 4 additions & 2 deletions Mixpanel/MixpanelAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ public static void RegisterOnce(string key, Value value)
{
if (!IsInitialized()) return;
Value properties = MixpanelStorage.OnceProperties;
properties[key] = value;
MixpanelStorage.OnceProperties = properties;
if (properties[key].IsNull) {
properties[key] = value;
MixpanelStorage.OnceProperties = properties;
}
}

/// <summary>
Expand Down