From 6c56263791c80676518532c9f91e0fb3d84fd079 Mon Sep 17 00:00:00 2001 From: real-zephex Date: Sat, 11 May 2024 02:01:28 +0530 Subject: adjustments to the cache system --- src/app/anime/[id]/page.jsx | 3 ++- src/app/anime/components/episode_buttons.jsx | 11 +++++++++++ src/app/anime/styles/buttons.module.css | 11 +++++++++++ src/app/anime/styles/pop_recent_top.module.css | 6 +----- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/app/anime/[id]/page.jsx b/src/app/anime/[id]/page.jsx index 0b85e8e..edd100a 100644 --- a/src/app/anime/[id]/page.jsx +++ b/src/app/anime/[id]/page.jsx @@ -10,7 +10,8 @@ const AnimeInfoHomepage = async ({ params }) => { const id = params.id; const data = await anime_info(id); - preFetchVideoLinks(data.episodes.slice(0, 49)); + const sliceLength = Math.min(data.episodes.length, 49); + preFetchVideoLinks(data.episodes.slice(0, sliceLength)); return (
diff --git a/src/app/anime/components/episode_buttons.jsx b/src/app/anime/components/episode_buttons.jsx index 3336470..9d6e1ca 100644 --- a/src/app/anime/components/episode_buttons.jsx +++ b/src/app/anime/components/episode_buttons.jsx @@ -31,6 +31,16 @@ const EpisodesButtons = ({ data: data }) => { } function createButtonGroups(start, end) { + try { + document.getElementById("episode-button").style.backgroundColor = + "#1f1f1fd2"; + } catch (error) { + console.error( + "ERROR: This error is expected. This is done in order to reset the background color of the buttons. I can't think of a better way than this....so yeah.", + error.message + ); + } + return (
{data.episodes && @@ -38,6 +48,7 @@ const EpisodesButtons = ({ data: data }) => {