Skip to content

Commit

Permalink
Fix Javascript error when reading time option is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Oct 7, 2023
1 parent fe21f6a commit d0377d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/ui/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ function handleFetchOriginalContent() {
response.json().then((data) => {
if (data.hasOwnProperty("content") && data.hasOwnProperty("reading_time")) {
document.querySelector(".entry-content").innerHTML = data.content;
document.querySelector(".entry-reading-time").innerHTML = data.reading_time;
let entryReadingtimeElement = document.querySelector(".entry-reading-time");
if (entryReadingtimeElement) {
entryReadingtimeElement.innerHTML = data.reading_time;
}
}
});
});
Expand Down

0 comments on commit d0377d5

Please sign in to comment.