Skip to content

Commit 3aa2121

Browse files
authored
ensure context is defined when fetching segments (#2443)
1 parent bfac763 commit 3aa2121

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

frontend/projects/upgrade/src/app/features/dashboard/home/components/experiment-participants/experiment-participants.component.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export class ExperimentParticipantsComponent implements OnInit {
9999
this.members2DataSource.next(this.members2.controls);
100100
// Bind predefined values of experiment participants from backend
101101
this.bindParticipantsData();
102-
this.setSegmentOptions();
103102
}
104103
}
105104

@@ -192,11 +191,10 @@ export class ExperimentParticipantsComponent implements OnInit {
192191
}
193192

194193
setSegmentOptions() {
195-
this.allSegmentsSub = this.segmentsService
196-
.selectListSegmentOptionsByContext(this.currentContext)
197-
.subscribe((allSegments) => {
198-
this.allSegmentListOptions = allSegments;
199-
});
194+
const context = this.currentContext || this.experimentInfo?.context[0];
195+
this.allSegmentsSub = this.segmentsService.selectListSegmentOptionsByContext(context).subscribe((allSegments) => {
196+
this.allSegmentListOptions = allSegments;
197+
});
200198
}
201199

202200
bindParticipantsData() {

0 commit comments

Comments
 (0)