From 2e496411a387493e87087d90deb4ed5efe3c3417 Mon Sep 17 00:00:00 2001 From: Renard Date: Wed, 25 Sep 2019 15:33:33 -0300 Subject: Variable destructuring ✨ --- src/Post.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/Post.js') diff --git a/src/Post.js b/src/Post.js index 9a467cb..8193ec1 100644 --- a/src/Post.js +++ b/src/Post.js @@ -69,6 +69,9 @@ const QuickReplyModal = ({ trigger, currentBoard, id, locked, replyIndex }) => ( ); const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => { + const filesize = require("filesize"); + + // Manejo de posts eliminados if (post.IS_DELETED > 0) { return ( @@ -94,8 +97,8 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => { ); } + // Obtener un avatar aleatorio basado en ID let user_id = post.timestamp_formatted.split(" ID:")[1]; - const filesize = require("filesize"); const seedrandom = require("seedrandom"); const rng = seedrandom(threadId + index); const idRng = seedrandom(user_id); @@ -119,8 +122,8 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => { hue = Math.round(rng() * 360); } + // Obetener bandera del pais (para /world) let flag; - if (currentBoard.dir === "world") { flag = post.name.match("[A-Z][A-Z]"); if (flag !== null) { @@ -130,11 +133,13 @@ const Post = ({ index, post, locked, threadId, currentBoard, nightMode }) => { } } + // Fix: imagenes en dominio incorrecto post.message = post.message.replace( ' { if (post.tripcode === " (★ ****-****)") { post.tripcode = ""; } - //(?:https?:\/\/)?(?:www\.)?youtu(.be\/|be\.com\/watch\?v=)(\w{11}) + + // Obtener lista de videos de youtube incrustados const youtubeRe = RegExp( /(?:https?:\/\/)?(?:www\.)?youtu(.be\/|be\.com\/watch\?v=)(\w{11})/g ); -- cgit v1.2.1-18-gbd029