Skip to content

Commit

Permalink
Merge branch 'develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
SKannaniOS authored Dec 9, 2024
2 parents 1a77509 + 67c6715 commit 739ad73
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Sources/Classes/RSClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,7 @@ - (void) alias:(NSString *)newId options:(RSOption *) options {
RSContext *rc = [RSElementCache getContext];
NSMutableDictionary<NSString*,NSObject*>* traits = [rc.traits mutableCopy];

NSObject *prevId = [traits objectForKey:@"userId"];
if(prevId == nil) {
prevId =[traits objectForKey:@"id"];
}
NSObject *prevId = [traits objectForKey:@"userId"] ?: [traits objectForKey:@"id"] ?: self.anonymousId;

traits[@"id"] = newId;
traits[@"userId"] = newId;
Expand Down

0 comments on commit 739ad73

Please sign in to comment.