Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
atharva-kakarot committed Jun 12, 2024
1 parent 1e5be07 commit b89319b
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions js/anime_about.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,6 @@ function localStorageFunc(str) {
localStorage.setItem("format", str.format);
}

function nullfunc(str) {
if (str === null) {
return "N/A";
}
else {
return str;
}
}

function animeContainer(str) {
const animeCard = document.createElement("div");
animeCard.classList.add("search-anime-cards");
Expand All @@ -164,7 +155,7 @@ function animeContainer(str) {
image.classList.add("search-anime-image");
image.src = str.coverImage.extraLarge;

const format = nullfunc(str.format);
const format = nullFuncSearch(str.format);

const formatMap = {
"TV_SHORT": "TV Short",
Expand All @@ -178,8 +169,8 @@ function animeContainer(str) {

const updatedFormatString = formatMap[format] || format;

const episodes = nullfunc(str.episodes);
const season = nullfunc(str.season);
const episodes = nullFuncSearch(str.episodes);
const season = nullFuncSearch(str.season);

const seasonMap = {
"WINTER": "Winter",
Expand All @@ -190,8 +181,8 @@ function animeContainer(str) {

const updatedSeasonString = seasonMap[season] || season;

const endDate = nullfunc(str.endDate.year);
const averageScore = nullfunc(str.averageScore);
const endDate = nullFuncSearch(str.endDate.year);
const averageScore = nullFuncSearch(str.averageScore);

const details = document.createElement("div");
details.classList.add("search-anime-details");
Expand Down Expand Up @@ -377,6 +368,7 @@ bannerImage.classList.add("banner-image");
bannerImage.src = localStorage.getItem("banner image");

if (bannerImage.src === "http://127.0.0.1:5500/null") {
localStorage.removeItem("banner image");
bannerImageDiv.style.display = "none";
}
else {
Expand Down

0 comments on commit b89319b

Please sign in to comment.