From e1791ea7378fe06c436566a9b36f0f2aaee751a6 Mon Sep 17 00:00:00 2001 From: Hager Eldakroury Date: Sat, 17 Jul 2021 02:18:38 +0200 Subject: [PATCH] fix: conditions order --- analysis/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/analysis/index.ts b/analysis/index.ts index ffe7ef7..889891d 100644 --- a/analysis/index.ts +++ b/analysis/index.ts @@ -39,14 +39,14 @@ io.on("connection", (socket: any) => { out: 0, }; } + if (!(meeting in emotions)) { + emotions[meeting] = {}; + } + if (student && !emotions[meeting][student]) { instructors[meeting]["out"]++; emotions[meeting][student] = "out"; } - - if (!(meeting in emotions)) { - emotions[meeting] = {}; - } }); socket.on(