Skip to content

Commit

Permalink
touchup(pane): show claims if have explicit claims
Browse files Browse the repository at this point in the history
  • Loading branch information
keyserj committed Mar 1, 2023
1 parent ad96579 commit 3191140
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions web/src/modules/topic/components/TopicPane/TopicPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { viewClaimDiagram, viewCriteriaTable, viewProblemDiagram } from "../../s
import { useNodes } from "../../store/nodeHooks";
import {
problemDiagramId,
useClaimDiagramIdentifiers,
useClaimDiagramsWithExplicitClaims,
useRootTitle,
useTopicViewId,
} from "../../store/store";
Expand All @@ -36,7 +36,7 @@ export const TopicPane = () => {
const topicViewId = useTopicViewId();

const rootTitle = useRootTitle();
const claimDiagramIdentifiers = useClaimDiagramIdentifiers();
const claimDiagramIdentifiers = useClaimDiagramsWithExplicitClaims();
const problems = useNodes(problemDiagramId, (node) => node.type === "problem");

const handleDrawerToggle = () => {
Expand Down
4 changes: 2 additions & 2 deletions web/src/modules/topic/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ export const useActiveTableProblemId = () => {
return useTopicStoreAfterHydration((state) => state.activeTableProblemId);
};

export const useClaimDiagramIdentifiers = () => {
export const useClaimDiagramsWithExplicitClaims = () => {
return useTopicStoreAfterHydration((state) =>
Object.entries(state.diagrams)
.filter(([id, _]) => id !== problemDiagramId)
.filter(([id, diagram]) => id !== problemDiagramId && diagram.nodes.length > 1)
.map(([id, diagram]) => [id, diagram.nodes[0].data.label])
);
};
Expand Down

0 comments on commit 3191140

Please sign in to comment.