Skip to content

Commit

Permalink
chore: optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Mar 25, 2024
1 parent 84de12e commit 5acf0d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/phim/_season.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1027,8 +1027,8 @@ watchEffect(async (onCleanup): Promise<void> => {
}
})
const currentMetaChap = computed(() => {
if (!currentChap.value) return
return currentDataSeason.value?.chaps.find(
if (!currentChap.value || !currentDataSeason.value) return null
return currentDataSeason.value.chaps.find(
(item) => item.id === currentChap.value
)
})
Expand Down Expand Up @@ -1065,6 +1065,7 @@ watchEffect(() => {
// currentChap != undefined because is load done from firestore and ready show but in chaps not found (!currentMetaChap.value)
if (!currentDataSeason.value) return
if (!currentChap.value) return
if (currentMetaChap.value === null) return
if (!currentMetaChap.value) {
const epId = currentChap.value
Expand Down

0 comments on commit 5acf0d8

Please sign in to comment.