Skip to content

Commit ce2a3f9

Browse files
[FSSDK-10766] cleanup
1 parent 6ed52e4 commit ce2a3f9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/core/decision_service/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ export class DecisionService {
538538
variation: Variation,
539539
userProfileTracker: UserProfileTracker
540540
): void {
541-
if(!userProfileTracker?.userProfile) {
541+
if(!userProfileTracker.userProfile) {
542542
return
543543
}
544544

@@ -559,14 +559,16 @@ export class DecisionService {
559559
userId: string,
560560
userProfileTracker: UserProfileTracker
561561
): void {
562-
if (!this.userProfileService || !userProfileTracker?.userProfile || !userProfileTracker.isProfileUpdated) {
562+
const { userProfile, isProfileUpdated } = userProfileTracker;
563+
564+
if (!this.userProfileService || !userProfile || !isProfileUpdated) {
563565
return;
564566
}
565-
console.log('Hitting save user profile', userId)
567+
566568
try {
567569
this.userProfileService.save({
568570
user_id: userId,
569-
experiment_bucket_map: userProfileTracker.userProfile,
571+
experiment_bucket_map: userProfile,
570572
});
571573

572574
this.logger.log(
@@ -594,7 +596,6 @@ export class DecisionService {
594596
featureFlags: FeatureFlag[],
595597
user: OptimizelyUserContext,
596598
options: { [key: string]: boolean } = {}): DecisionResponse<DecisionObj>[] {
597-
console.log('get variation for feature list is called', featureFlags)
598599
const userId = user.getUserId();
599600
const attributes = user.getAttributes();
600601
const decisions: DecisionResponse<DecisionObj>[] = [];

0 commit comments

Comments
 (0)