Add disabled state constraints to progress adjustment buttons in Anime component
- Disable decrement button when progress is at 0 or below to prevent negative values - Disable increment button when: * Media has defined episodes and progress is complete (>= total episodes) * Or when progress has reached next airing episode boundary (nextAiringEpisode - 2) - Improves user experience by preventing invalid progress adjustments - Maintains data integrity by stopping users from setting impossible progress values
This commit is contained in:
@@ -483,6 +483,7 @@
|
|||||||
completedAtDate = null;
|
completedAtDate = null;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
disabled={currentAniListAnime.data.MediaList.progress <= 0}
|
||||||
class="bg-gray-700 hover:bg-gray-600 border-gray-600 border rounded-s-lg p-3 h-11 focus:ring-gray-700 focus:ring-2 focus:outline-none"
|
class="bg-gray-700 hover:bg-gray-600 border-gray-600 border rounded-s-lg p-3 h-11 focus:ring-gray-700 focus:ring-2 focus:outline-none"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -541,6 +542,16 @@
|
|||||||
if (startedAtDate === null) startedAtDate = new Date();
|
if (startedAtDate === null) startedAtDate = new Date();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
disabled={(currentAniListAnime.data.MediaList.media.episodes >
|
||||||
|
0 &&
|
||||||
|
currentAniListAnime.data.MediaList.progress >=
|
||||||
|
currentAniListAnime.data.MediaList.media.episodes) ||
|
||||||
|
(currentAniListAnime.data.MediaList.media.nextAiringEpisode
|
||||||
|
.episode > 0 &&
|
||||||
|
currentAniListAnime.data.MediaList.progress >
|
||||||
|
currentAniListAnime.data.MediaList.media.nextAiringEpisode
|
||||||
|
.episode -
|
||||||
|
2)}
|
||||||
class="bg-gray-700 hover:bg-gray-600 border-gray-600 border rounded-e-lg p-3 h-11 focus:ring-gray-700 focus:ring-2 focus:outline-none"
|
class="bg-gray-700 hover:bg-gray-600 border-gray-600 border rounded-e-lg p-3 h-11 focus:ring-gray-700 focus:ring-2 focus:outline-none"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
|
|||||||
Reference in New Issue
Block a user