Skip to content

Commit

Permalink
improve conditionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Lai committed Aug 21, 2024
1 parent 7c8c802 commit 20a161a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/pages/studyView/StudyViewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ export default class StudyViewPage extends React.Component<
structuralVariants={
this.store.structuralVariants
}
hugoGeneSymbols={
allHugoGeneSymbols={
this.store.allHugoGeneSymbols
}
selectedGenericAssayEntitiesGroupByMolecularProfileId={
Expand Down
16 changes: 8 additions & 8 deletions src/shared/components/plots/PlotsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ export interface IPlotsTabProps {
driverAnnotationSettings: DriverAnnotationSettings;
studyIdToStudy?: MobxPromiseUnionTypeWithDefault<_.Dictionary<CancerStudy>>;
structuralVariants?: MobxPromiseUnionType<StructuralVariant[]>;
hugoGeneSymbols: string[] | MobxPromiseUnionTypeWithDefault<string[]>;
hugoGeneSymbols?: string[];
allHugoGeneSymbols?: MobxPromiseUnionTypeWithDefault<string[]>;
selectedGenericAssayEntitiesGroupByMolecularProfileId: {
[molecularProfileId: string]: string[];
};
Expand Down Expand Up @@ -3673,15 +3674,16 @@ export default class PlotsTab extends React.Component<IPlotsTabProps, {}> {
}
let genericAssayOptionsCount: number = 0;
let filteredGenericAssayOptionsCount: number = 0;
const hugoGeneSymbols: string[] = this.props.hugoGeneSymbols
? this.props.hugoGeneSymbols
: this.props.allHugoGeneSymbols!.result;
if (vertical && this.vertGenericAssayOptions.result) {
genericAssayOptions =
this.makeGenericAssayGroupOptions(
this.vertGenericAssayOptions.result,
selectedEntities,
this._vertGenericAssaySearchText,
Array.isArray(this.props.hugoGeneSymbols)
? this.props.hugoGeneSymbols
: this.props.hugoGeneSymbols.result,
hugoGeneSymbols,
this.horzSelection.selectedGeneOption?.label,
GENERIC_ASSAY_CONFIG.genericAssayConfigByType[
axisSelection.dataType!
Expand Down Expand Up @@ -3709,9 +3711,7 @@ export default class PlotsTab extends React.Component<IPlotsTabProps, {}> {
this.horzGenericAssayOptions.result,
selectedEntities,
this._horzGenericAssaySearchText,
Array.isArray(this.props.hugoGeneSymbols)
? this.props.hugoGeneSymbols
: this.props.hugoGeneSymbols.result,
hugoGeneSymbols,
this.vertSelection.selectedGeneOption?.label,
GENERIC_ASSAY_CONFIG.genericAssayConfigByType[
axisSelection.dataType!
Expand Down Expand Up @@ -3754,7 +3754,7 @@ export default class PlotsTab extends React.Component<IPlotsTabProps, {}> {
options = options.filter(stringCompare).slice(0, 10);
const genes = await fetchGenes(options.map(o => o.label));
const coverageInformationPromise = getCoverageInformation(
this.props.genePanelDataForAllProfiles?.result || [],
this.props.genePanelDataForAllProfiles!.result!,
this.props.sampleKeyToSample.result!,
this.props.patients.result!,
genes
Expand Down

0 comments on commit 20a161a

Please sign in to comment.