Skip to content

Commit

Permalink
fix(graph): correct default option
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Dec 21, 2023
1 parent d6f6c8b commit 8dee5e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/src/pages/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ export default function Home() {
},
];

const graphOptions = Object.keys(data?.graph || { authors: 0 });
const [selectedOption, setSelectedOption] = useState(graphOptions[0]);

const conditions = [
{
label: 'OR',
Expand All @@ -159,6 +156,9 @@ export default function Home() {
},
];

const graphOptions = Object.keys(data?.graph || { main: 0 });
const [selectedOption, setSelectedOption] = useState(graphOptions[0]);

return (
<Container className="fr-my-15w">
<Title as="h1">Community Detection POC</Title>
Expand Down Expand Up @@ -327,7 +327,7 @@ export default function Home() {
</Row>
<Button
className="fr-btn fr-btn--tertiary fr-btn--icon-right fr-icon-download-line"
onClick={() => exportJson(graphEncodeToJson(data.graph.authors))}
onClick={() => exportJson(graphEncodeToJson(data.graph[selectedOption]))}
>
Download graph
</Button>
Expand Down

0 comments on commit 8dee5e9

Please sign in to comment.