aboutsummaryrefslogtreecommitdiff
path: root/src/app/anime/components
diff options
context:
space:
mode:
authorreal-zephex <[email protected]>2024-05-11 02:08:44 +0530
committerreal-zephex <[email protected]>2024-05-11 02:08:44 +0530
commit8938d5099e7b3f89a595cd90aadec89507f21695 (patch)
treeebc56f72e85458a94d8d110b2b3713181f87b6ce /src/app/anime/components
parentadjustments to the cache system (diff)
downloaddramalama-8938d5099e7b3f89a595cd90aadec89507f21695.tar.xz
dramalama-8938d5099e7b3f89a595cd90aadec89507f21695.zip
adjustments to the cache system
Diffstat (limited to 'src/app/anime/components')
-rw-r--r--src/app/anime/components/episode_buttons.jsx10
1 files changed, 6 insertions, 4 deletions
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)";