Add error handling

This commit is contained in:
Annie Huang committed 2023-11-20 15:41:08 +08:00
1 parent 2837354456
commit 83994106a0
1 file changed
+5
+5
View File
@@ -93,11 +93,16 @@ function getOption(quests, progress) {
unlocked: node.requirements.every((req) => progress[req]?.completed), unlocked: node.requirements.every((req) => progress[req]?.completed),
})) }))
const lineAppearence = (node) => { const lineAppearence = (node) => {
try {
const { unlocked } = node const { unlocked } = node
return { return {
type: unlocked ? 'line' : 'dashed', type: unlocked ? 'line' : 'dashed',
color: unlocked ? '#ADADB5' : '#454552', color: unlocked ? '#ADADB5' : '#454552',
} }
} catch (err) {
console.error(err)
throw err
}
} }
const edges = dag.getEdgesArray().map((edge) => ({ const edges = dag.getEdgesArray().map((edge) => ({
source: edge[0], source: edge[0],