Skip to content

Commit

Permalink
fix: fix view tomogram button greyed out error (#1323)
Browse files Browse the repository at this point in the history
  • Loading branch information
kne42 authored Nov 6, 2024
1 parent 7032211 commit 5a6ca7a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ export function RunsTable() {

columnHelper.accessor(
(run) =>
run.tomogram_voxel_spacings?.[0]?.tomograms?.[0]?.neuroglancer_config,
run.tomogram_voxel_spacings?.find(
(voxelSpacing) => voxelSpacing.tomograms[0].neuroglancer_config,
)?.tomograms?.[0]?.neuroglancer_config,
{
id: 'viewTomogram',
header: () => <CellHeader width={RunTableWidths.actions} />,
Expand All @@ -231,7 +233,11 @@ export function RunsTable() {
const neuroglancerConfig = getValue()

const run = row.original
const tomogram = run.tomogram_voxel_spacings.at(0)?.tomograms.at(0)
const tomogram = run.tomogram_voxel_spacings
.find(
(voxelSpacing) => voxelSpacing.tomograms[0].neuroglancer_config,
)
?.tomograms.at(0)

return (
<TableCell horizontalAlign="right" width={RunTableWidths.actions}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ const GET_DATASET_BY_ID = gql(`
object_name
}
tomograms(limit: 1) {
tomograms(limit: 1, where: { neuroglancer_config: { _is_null: false } }) {
id
key_photo_thumbnail_url
neuroglancer_config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ const GET_RUN_BY_ID_QUERY_V2 = gql(`
tomograms(
first: 1
where: {
isVisualizationDefault: { _eq: true }
}
# where: {
# isAuthorSubmitted: { _eq: true } # TODO(bchu): Uncomment when bool bug fixed.
# }
Expand Down

0 comments on commit 5a6ca7a

Please sign in to comment.