Add comment about setTimeout hack

This commit is contained in:
Hamcha 2019-09-16 12:08:02 +02:00
parent c8697d8893
commit dddeca9867
Signed by: hamcha
GPG Key ID: 44AD3571EB09A39E
1 changed files with 1 additions and 0 deletions

View File

@ -5,6 +5,7 @@ export class DraftBot {
assign(player: SessionPlayer) {
player.on("available-picks", cards => {
const pick = this.pick(cards);
// setTimeout hack to avoid handlers being called before the rest of the code
setTimeout(() => player.pick(pick.ID), 0);
});
}