From 15c6542da378f617e5ef85321afa9607a6e1050c Mon Sep 17 00:00:00 2001 From: frankwhoee Date: Mon, 2 Oct 2023 20:26:24 -0700 Subject: [PATCH] Fix bug --- script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index cfe23e8..5bf211f 100644 --- a/script.js +++ b/script.js @@ -42,8 +42,8 @@ if (curr_read != undefined) { count.textContent = total_read_poems; const today = new Date(); - -if (paramTitle == undefined || curr_poem == undefined || last_time_visited == undefined || today.toDateString() !== new Date(parseInt(last_time_visited)).toDateString()) { +console.log(paramTitle == null) +if (paramTitle == null && (curr_poem == undefined || last_time_visited == undefined || today.toDateString() !== new Date(parseInt(last_time_visited)).toDateString())) { showRandomPoem().then((res) => { let id = res[0]; let title = res[1];