From 94136dbb69ac2b33318315fe81d2f979602f1df0 Mon Sep 17 00:00:00 2001 From: Mark Beamer Jr Date: Sun, 1 Sep 2019 22:30:22 -0400 Subject: [PATCH] Add console error for heroku log. Fix bug where there was not check on undefined metadata. Fix bug where claims from list trending are not part of a channel. --- app/helpers/fetch-metadata.js | 1 + app/sockets.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/helpers/fetch-metadata.js b/app/helpers/fetch-metadata.js index c38cd4e..bdef885 100644 --- a/app/helpers/fetch-metadata.js +++ b/app/helpers/fetch-metadata.js @@ -260,6 +260,7 @@ export default async(data, socket) => { return response.body.result[Object.keys(response.body.result)[0]]; } catch(error) { + console.error(error); messageSlack({ message: "```" + error + "```", pretext: "_Someone is going through the Playground and the daemon is not running_", diff --git a/app/sockets.js b/app/sockets.js index e7baf6b..b6f4d81 100644 --- a/app/sockets.js +++ b/app/sockets.js @@ -136,9 +136,10 @@ function generateContent(exampleNumber, displayTrendingContent) { Promise.all(rawContentCollection) .then(collection => { for (const part of collection) { - if (part.value.tags && part.value.tags.includes("mature")) + if (part && part.value.tags && part.value.tags.includes("mature")) + continue; + if (part === undefined) continue; - try { renderedContentCollection.push(`
@@ -154,7 +155,7 @@ function generateContent(exampleNumber, displayTrendingContent) {
- ${part.signing_channel.name || "Anon"} + ${part.signing_channel ? part.signing_channel.name : "Anon"}
`);