Skip to content

Commit

Permalink
Fix bug which caused loading issues in certain edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Aug 14, 2024
1 parent e37bf3e commit 6c876b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,20 +314,21 @@ watch(() => state.ppn, async (ppn) => {
for (const mapping of mappings) {
const targetSide = ["from", "to"].find(side => jskos.conceptsOfMapping(mapping, side).filter(concept => jskos.isContainedIn(concept, subjects)).length === 0)
let target = jskos.conceptsOfMapping(mapping, targetSide)[0]
if (!target) {
const targetScheme = mapping[`${targetSide}Scheme`]
if (!target || !targetScheme) {
continue
}
target = {
...target,
inScheme: [mapping[`${targetSide}Scheme`]],
inScheme: [targetScheme],
}
const existingSuggestion = suggestions.find(s => jskos.compare(s.target, target))
if (existingSuggestion) {
existingSuggestion.mappings.push(mapping)
} else {
suggestions.push({
target,
scheme: target.inScheme[0],
scheme: targetScheme,
mappings: [mapping],
selected: false,
})
Expand Down

0 comments on commit 6c876b7

Please sign in to comment.