From ec729f3b1e985df16d8ce47172e0ea202d88b925 Mon Sep 17 00:00:00 2001 From: Chandler Mayo Date: Fri, 1 May 2020 13:07:21 -0400 Subject: [PATCH] Fix link bug. --- good-news-dashboard/dashboard.html | 4 ++-- good-news-dashboard/dashboard.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/good-news-dashboard/dashboard.html b/good-news-dashboard/dashboard.html index 342d591..73d106b 100644 --- a/good-news-dashboard/dashboard.html +++ b/good-news-dashboard/dashboard.html @@ -1,6 +1,6 @@ - + Good News Machine @@ -45,7 +45,7 @@

TODAY'S BEST NEWS

- + diff --git a/good-news-dashboard/dashboard.js b/good-news-dashboard/dashboard.js index 9b40045..1dfbb6e 100644 --- a/good-news-dashboard/dashboard.js +++ b/good-news-dashboard/dashboard.js @@ -230,6 +230,7 @@ function refreshPosts() { } let title = truncate(currentPost.post.title, 98); let votes = currentPost.votes; + let link = currentPost.post.link; let request = new XMLHttpRequest(); request.onreadystatechange = function() { let postVoteCount = 0; @@ -238,7 +239,7 @@ function refreshPosts() { if (postVoteCount < votes) { // The object may have been removed from history. postVoteCount = votes; } - posts.push([Number(postVoteCount), "

"+title+"

"+description+"

⭐ "+postVoteCount+" Votes

"]); + posts.push([Number(postVoteCount), "

"+title+"

"+description+"

⭐ "+postVoteCount+" Votes

"]); addToTop(posts.sort(function(a,b) { return a[0]-b[0]; }));