Skip to content

Commit

Permalink
[Platform]: Replace unsafe destructuring assignments on study page (#558
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gjmcn authored Nov 25, 2024
1 parent a62e16f commit 616cd12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sections/src/study/GWASCredibleSets/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const columns = [
tooltip: "Top gene prioritised by our locus-to-gene model",
filterValue: ({ l2Gpredictions }) => l2Gpredictions?.[0]?.target.approvedSymbol,
renderCell: ({ l2Gpredictions }) => {
const { target } = l2Gpredictions?.[0];
const target = l2Gpredictions?.[0]?.target;
if (!target) return naLabel;
return <Link to={`/target/${target.id}`}>{target.approvedSymbol}</Link>;
},
Expand All @@ -106,7 +106,7 @@ const columns = [
sortable: true,
filterValue: false,
renderCell: ({ l2Gpredictions }) => {
const { score } = l2Gpredictions?.[0];
const score = l2Gpredictions?.[0]?.score;
if (typeof score !== "number") return naLabel;
return score.toFixed(3);
},
Expand Down

0 comments on commit 616cd12

Please sign in to comment.