mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-28 08:56:05 +00:00
consistent returns
This commit is contained in:
parent
cfa3cfd072
commit
0a15bb2023
|
@ -52,7 +52,7 @@ function useSeasons(
|
||||||
) {
|
) {
|
||||||
const state = useAsync(async () => {
|
const state = useAsync(async () => {
|
||||||
if (isLastEpisode) {
|
if (isLastEpisode) {
|
||||||
if (!mediaId) return;
|
if (!mediaId) return null;
|
||||||
const data = await getMetaFromId(MWMediaType.SERIES, mediaId);
|
const data = await getMetaFromId(MWMediaType.SERIES, mediaId);
|
||||||
if (data?.meta.type !== MWMediaType.SERIES) return null;
|
if (data?.meta.type !== MWMediaType.SERIES) return null;
|
||||||
return data.meta.seasons;
|
return data.meta.seasons;
|
||||||
|
@ -68,7 +68,7 @@ function useNextSeasonEpisode(
|
||||||
) {
|
) {
|
||||||
const state = useAsync(async () => {
|
const state = useAsync(async () => {
|
||||||
if (nextSeason) {
|
if (nextSeason) {
|
||||||
if (!mediaId) return;
|
if (!mediaId) return null;
|
||||||
const data = await getMetaFromId(
|
const data = await getMetaFromId(
|
||||||
MWMediaType.SERIES,
|
MWMediaType.SERIES,
|
||||||
mediaId,
|
mediaId,
|
||||||
|
|
Loading…
Reference in a new issue