From d440ee128e5e13e7df16c03e5028484cbee99e05 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 8 Dec 2022 00:44:29 -0800 Subject: [PATCH] Fix replay of comments by putting them after replay of images Since the elements we want to append comments to are only created by the images. --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 11fac96..55e1798 100644 --- a/index.js +++ b/index.js @@ -77,12 +77,12 @@ io.on('connection', (socket) => { // Replay old comments and images to a newly-joining client socket.emit('reset'); - state.comments.forEach((comment) => { - socket.emit('comment', comment) - }); state.images.forEach((image) => { socket.emit('image', image) }); + state.comments.forEach((comment) => { + socket.emit('comment', comment) + }); socket.on('set-name', (name) => { console.log("Received set-name event: " + name); -- 2.43.0