@@ -538,7 +538,7 @@ export class DecisionService {
538
538
variation : Variation ,
539
539
userProfileTracker : UserProfileTracker
540
540
) : void {
541
- if ( ! userProfileTracker ? .userProfile ) {
541
+ if ( ! userProfileTracker . userProfile ) {
542
542
return
543
543
}
544
544
@@ -559,14 +559,16 @@ export class DecisionService {
559
559
userId : string ,
560
560
userProfileTracker : UserProfileTracker
561
561
) : void {
562
- if ( ! this . userProfileService || ! userProfileTracker ?. userProfile || ! userProfileTracker . isProfileUpdated ) {
562
+ const { userProfile, isProfileUpdated } = userProfileTracker ;
563
+
564
+ if ( ! this . userProfileService || ! userProfile || ! isProfileUpdated ) {
563
565
return ;
564
566
}
565
- console . log ( 'Hitting save user profile' , userId )
567
+
566
568
try {
567
569
this . userProfileService . save ( {
568
570
user_id : userId ,
569
- experiment_bucket_map : userProfileTracker . userProfile ,
571
+ experiment_bucket_map : userProfile ,
570
572
} ) ;
571
573
572
574
this . logger . log (
@@ -594,7 +596,6 @@ export class DecisionService {
594
596
featureFlags : FeatureFlag [ ] ,
595
597
user : OptimizelyUserContext ,
596
598
options : { [ key : string ] : boolean } = { } ) : DecisionResponse < DecisionObj > [ ] {
597
- console . log ( 'get variation for feature list is called' , featureFlags )
598
599
const userId = user . getUserId ( ) ;
599
600
const attributes = user . getAttributes ( ) ;
600
601
const decisions : DecisionResponse < DecisionObj > [ ] = [ ] ;
0 commit comments