From: Carl Worth Date: Fri, 9 Dec 2022 21:08:37 +0000 (-0800) Subject: Add empty comments array when creating a new image X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=7dd4521eb06dd0292956576a98625a75aad310e1;p=zombocom-ai Add empty comments array when creating a new image Otherwise things would just break. --- diff --git a/index.js b/index.js index 49a8566..b0e7d7a 100644 --- 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); });