Skip to content

Commit

Permalink
Fix cell types not found issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kplatis committed May 16, 2024
1 parent dc35d02 commit 58c13fa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/state/build-section/cell-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export const cellTypesByIdAtom = selectAtom<
Promise<any> | null,
Promise<Record<string, ClassNexus> | undefined> | null
>(cellTypesAtom, (cellTypes) => {
if (!cellTypes) return null;

if (!cellTypes || !cellTypes.hits) return null;
return cellTypes.hits.hits.reduce(
(acc: Record<string, ClassNexus>, classObj: ClassESResponse) => {
acc[classObj._source['@id']] = classObj._source;
Expand All @@ -57,7 +56,7 @@ export const cellTypesByLabelAtom = selectAtom<
Promise<any> | null,
Promise<Record<string, ClassNexus> | undefined> | null
>(cellTypesAtom, (cellTypes) => {
if (!cellTypes) return null;
if (!cellTypes || !cellTypes.hits) return null;

return cellTypes.hits.hits.reduce(
(acc: Record<string, ClassNexus>, classObj: ClassESResponse) => {
Expand Down

0 comments on commit 58c13fa

Please sign in to comment.