From 56d96cf7a0c8f31289155f74057d9747a8adccf8 Mon Sep 17 00:00:00 2001 From: "Lin, Hung-Shin" Date: Tue, 21 Nov 2023 12:16:01 +0800 Subject: [PATCH] fix: only send hints when it's not empty --- server/src/game/sessionHandler.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src/game/sessionHandler.js b/server/src/game/sessionHandler.js index 906126b..0688041 100644 --- a/server/src/game/sessionHandler.js +++ b/server/src/game/sessionHandler.js @@ -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) }, }