From 5fe8ea1b85299564686f3fba331644e1178f363e Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sun, 22 Jan 2023 20:47:39 -0500 Subject: bug fixes --- public/404.html | 6 +++--- public/home.html | 14 +++++++------- public/js/api.js | 2 +- public/js/home.js | 11 +++++++++++ public/login.html | 8 ++++---- public/people.html | 14 +++++++------- public/profile.html | 18 +++++++++--------- 7 files changed, 42 insertions(+), 31 deletions(-) (limited to 'public') diff --git a/public/404.html b/public/404.html index 49f0d5d..04ddadc 100644 --- a/public/404.html +++ b/public/404.html @@ -2,9 +2,9 @@ - - - + + + XSSBook - Not Found diff --git a/public/home.html b/public/home.html index cc780ac..79c807b 100644 --- a/public/home.html +++ b/public/home.html @@ -2,16 +2,16 @@ - - - + + + XSSBook - Home - - - - + + + + \ No newline at end of file diff --git a/public/js/api.js b/public/js/api.js index 371ecf3..05a0906 100644 --- a/public/js/api.js +++ b/public/js/api.js @@ -1,4 +1,4 @@ -const endpoint = 'https://xssbook.com/api' +const endpoint = 'https://xssbook.com' const request = async (url, body, method) => { if (method === undefined) method = 'POST' diff --git a/public/js/home.js b/public/js/home.js index e0186a8..7697c29 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -7,6 +7,9 @@ function parseDate(date) { function parseComment(comment) { const author = data.users[comment.user] + if (author === undefined) { + author = {} + } const html = `
@@ -23,6 +26,9 @@ function parseComment(comment) { function parsePost(post) { const author = data.users[post.user] + if (author === undefined) { + author = {} + } const html = `
@@ -189,6 +195,11 @@ async function load() { data.posts.push(... posts) const batch = [] for (const post of posts) { + for(const comment of post.comments) { + if (data.users[comment.user] !== undefined) continue + if (batch.includes(comment.user)) continue + batch.push(comment.user) + } if (data.users[post.user] !== undefined) continue if (batch.includes(post.user)) continue batch.push(post.user) diff --git a/public/login.html b/public/login.html index 538d248..50b4724 100644 --- a/public/login.html +++ b/public/login.html @@ -2,10 +2,10 @@ - - - - + + + + XSSBook - Login diff --git a/public/people.html b/public/people.html index f0aa514..399751a 100644 --- a/public/people.html +++ b/public/people.html @@ -2,14 +2,14 @@ - - - + + + XSSBook - People - - - - + + + + \ No newline at end of file diff --git a/public/profile.html b/public/profile.html index 0274327..d17ab09 100644 --- a/public/profile.html +++ b/public/profile.html @@ -2,16 +2,16 @@ - - - - + + + + XSSBook - Profile - - - - - + + + + + \ No newline at end of file -- cgit v1.2.3-freya