X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=index.js;h=0ee5e4359255f4afe794114cd043950d0da2c85e;hb=344784f27434ed505982ffc74558af98ebb1a5b9;hp=8dadeabec11666785f14926cc567caf15c58033f;hpb=2bc133296a6a76a8705d1cc029ae900c39f339c2;p=zombocom-ai diff --git a/index.js b/index.js index 8dadeab..0ee5e43 100644 --- a/index.js +++ b/index.js @@ -48,10 +48,13 @@ app.get('/index.html', (req, res) => { io.on('connection', (socket) => { - // Replay old comments to a newly-joining client + // Replay old comments and images to a newly-joining client state.comments.forEach((comment) => { socket.emit('comment', comment) }); + state.images.forEach((image) => { + socket.emit('image', image) + }); // When any client comments, send that to all clients (including sender) socket.on('comment', (comment) => {