]> git.cworth.org Git - zombocom-ai/commitdiff
Hide images with a censored attribute
authorCarl Worth <cworth@cworth.org>
Mon, 19 Dec 2022 04:37:39 +0000 (20:37 -0800)
committerCarl Worth <cworth@cworth.org>
Mon, 19 Dec 2022 07:11:49 +0000 (23:11 -0800)
Which will allow for a message to be hidden in the set of which images
are censored by ZomboCom.

index.html
index.js

index b36254964a2212e889e68312db54f55e5c3c597e..27035a180506b124661ef9efd3992c11b1e6f6b6 100644 (file)
@@ -174,6 +174,10 @@ mute.addEventListener("click", () => {
         const figure = document.createElement('figure');
         figure.id = "image_" + image.id;
 
+        if (image.censored) {
+            figure.style.display = "none";
+        }
+
         const img = document.createElement('img');
         img.src = image.filename;
         figure.appendChild(img);
index 7bd8a10d3f7663a7ac8cc26e031a80a04d3c76d2..6f2a62597395c90c1a2e48884edaf3b65a5ec028 100644 (file)
--- a/index.js
+++ b/index.js
@@ -136,7 +136,8 @@ io.on('connection', (socket) => {
                 const images = JSON.parse(data);
                 images.forEach((image) => {
                     image.id = state.images.length;
-                   image.comments = [];
+                    image.censored = false;
+                    image.comments = [];
                     io.emit('image', image);
                     state.images.push(image);
                 });