From: Carl Worth Date: Thu, 8 Dec 2022 08:44:29 +0000 (-0800) Subject: Fix replay of comments by putting them after replay of images X-Git-Url: https://git.cworth.org/git?p=zombocom-ai;a=commitdiff_plain;h=d440ee128e5e13e7df16c03e5028484cbee99e05 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. --- 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);