]> git.cworth.org Git - zombocom-ai/blobdiff - index.js
Replay previous images to a client when it first connects
[zombocom-ai] / index.js
index 8dadeabec11666785f14926cc567caf15c58033f..0ee5e4359255f4afe794114cd043950d0da2c85e 100644 (file)
--- 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) => {