Skip to content

Commit

Permalink
fix(analytics): setUserId accepts null values (#757)
Browse files Browse the repository at this point in the history
* fix(analytics): setUserId accepts null values

* Add changeset

* Update .changeset/smooth-mirrors-bow.md

---------

Co-authored-by: Robin Genz <[email protected]>
  • Loading branch information
simondaigre and robingenz authored Nov 19, 2024
1 parent b57f1ee commit 610a4a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/smooth-mirrors-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@capacitor-firebase/analytics': patch
---

fix(web): `setUserId(...)` has set an empty string instead of `null`
2 changes: 1 addition & 1 deletion packages/analytics/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class FirebaseAnalyticsWeb

public async setUserId(options: SetUserIdOptions): Promise<void> {
const analytics = getAnalytics();
setUserId(analytics, options.userId || '');
setUserId(analytics, options.userId);
}

public async setUserProperty(options: SetUserPropertyOptions): Promise<void> {
Expand Down

0 comments on commit 610a4a1

Please sign in to comment.