Skip to content

Commit

Permalink
fix bug preventing result rows from being opened if there were no `su…
Browse files Browse the repository at this point in the history
…pport_graph`s
  • Loading branch information
Woozl committed Apr 10, 2024
1 parent 1416c7d commit 1034032
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/answer/useAnswerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ export default function useAnswerStore() {
const edgesJSON = {};
row.analyses.forEach((analysis) => {
const edge_bindings = Object.values(analysis.edge_bindings).flat();
const support_graph_edge_bindings = analysis.support_graphs.reduce((acc, support_graph_id) => (
[...acc, ...message.auxiliary_graphs[support_graph_id].edges.map((e) => ({ id: e }))]
), []);

const support_graph_edge_bindings = [];
if (Array.isArray(analysis.support_graphs)) {
analysis.support_graphs.forEach((supportGraphId) => {
support_graph_edge_bindings.push(...message.auxiliary_graphs[supportGraphId].edges.map((e) => ({ id: e })));
});
}

[...edge_bindings, ...support_graph_edge_bindings].forEach((binding) => {
const kgEdge = message.knowledge_graph.edges[binding.id];
Expand Down

0 comments on commit 1034032

Please sign in to comment.