Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit 9547305

Browse files
authored
Fix automatically setting user as anonymous when both key and anonymous are unspecified (#124)
1 parent a4f5de8 commit 9547305

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ios/LaunchdarklyReactNativeClient.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ class LaunchdarklyReactNativeClient: RCTEventEmitter {
102102

103103
private func userBuild(_ userDict: NSDictionary) -> LDUser {
104104
var user = LDUser(key: userDict["key"] as? String)
105-
user.isAnonymousNullable = userDict["anonymous"] as? Bool
105+
if let anon = userDict["anonymous"] as? Bool {
106+
user.isAnonymous = anon
107+
}
106108
user.secondary = userDict["secondary"] as? String
107109
user.name = userDict["name"] as? String
108110
user.firstName = userDict["firstName"] as? String

0 commit comments

Comments
 (0)