fix: only send hints when it's not empty

This commit is contained in:
Lin, Hung-Shin committed 2023-11-21 12:16:01 +08:00
1 parent a8ba2a640b
commit 56d96cf7a0
1 file changed
+4 -2
+4 -2
View File
@@ -47,7 +47,8 @@ export default class SessionHandler {
t.completed = true
})
this.session.hints.push(stage.hints)
if (stage.hints && stage.hints.length > 0)
this.session.hints.push(stage.hints)
this.addNewTasks()
@@ -56,7 +57,8 @@ export default class SessionHandler {
hints: stage.hints,
callback: () => {
pushToSession(this.session.id, 'tasks', this.session.tasks)
pushToSession(this.session.id, 'hints', stage.hints)
if (stage.hints && stage.hints.length > 0)
pushToSession(this.session.id, 'hints', stage.hints)
pushToSession(this.session.id, 'status', this.session.status)
},
}