mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: check global exceptions
This commit is contained in:
1 parent
98a226f3ff
commit
a7e646c28b
2 files changed
+38
-22
No files matched your search
@@ -19,16 +19,14 @@ export default class SessionHandler {
|
||||
return task ? task.completed : false
|
||||
}
|
||||
|
||||
getStages() {
|
||||
return this.quest.stages.filter(
|
||||
(stage) =>
|
||||
stage.requirements.every((r) => this.isCompleted({ id: r })) &&
|
||||
(stage.repeatable || !this.isCompleted(stage))
|
||||
getUnlockedComponents(components) {
|
||||
return components.filter((component) =>
|
||||
component.requirements.every((r) => this.isCompleted({ id: r }))
|
||||
)
|
||||
}
|
||||
|
||||
getNewTasks() {
|
||||
const stages = this.getStages()
|
||||
const stages = this.getUnlockedComponents(this.quest.stages)
|
||||
return stages
|
||||
.filter((s) => s.task)
|
||||
.filter((s) => !this.session.tasks.some((t) => t.id === s.id))
|
||||
|
||||
Reference in new issue
Block a user