]> git.cworth.org Git - zombocom-ai/commitdiff
Add empty comments array when creating a new image
authorCarl Worth <cworth@cworth.org>
Fri, 9 Dec 2022 21:08:37 +0000 (13:08 -0800)
committerCarl Worth <cworth@cworth.org>
Fri, 9 Dec 2022 21:08:37 +0000 (13:08 -0800)
Otherwise things would just break.

index.js

index 49a85669e45c3c436ccf2141042d4ca30f9c1339..b0e7d7ae4126428d383ddd31731f09feda8a570a 100644 (file)
--- a/index.js
+++ b/index.js
@@ -124,6 +124,7 @@ io.on('connection', (socket) => {
                 const images = JSON.parse(data);
                 images.forEach((image) => {
                     image.id = state.images.length;
+                   image.comments = [];
                     io.emit('image', image);
                     state.images.push(image);
                 });