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) => {
console.log("Error occurred during generate-image: " + data);
});
const { stdout, stderr } = await promise;
+ socket.emit('generation-done');
}
generate_image(request['code'], request['prompt']);
});