From 8938d5099e7b3f89a595cd90aadec89507f21695 Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Sat, 11 May 2024 02:08:44 +0530
Subject: adjustments to the cache system

---
 src/app/anime/components/episode_buttons.jsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src/app/anime/components/episode_buttons.jsx')

diff --git a/src/app/anime/components/episode_buttons.jsx b/src/app/anime/components/episode_buttons.jsx
index 9d6e1ca..30a8086 100644
--- a/src/app/anime/components/episode_buttons.jsx
+++ b/src/app/anime/components/episode_buttons.jsx
@@ -32,8 +32,11 @@ const EpisodesButtons = ({ data: data }) => {
 
 	function createButtonGroups(start, end) {
 		try {
-			document.getElementById("episode-button").style.backgroundColor =
-				"#1f1f1fd2";
+			// Reset background color of all buttons with the class "episode-button"
+			const buttons = document.getElementsByClassName("episode-button");
+			for (let i = 0; i < buttons.length; i++) {
+				buttons[i].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.",
@@ -46,9 +49,8 @@ const EpisodesButtons = ({ data: data }) => {
 				{data.episodes &&
 					data.episodes.slice(start, end).map((item, index) => (
 						<button
-							className={styles.dramaButton}
+							className={styles.dramaButton + " episode-button"} // Add the class "episode-button"
 							key={index}
-							id="episode-button"
 							onClick={(event) => {
 								event.target.style.backgroundColor =
 									"var(--soft-purple)";
-- 
cgit v1.2.3

