Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deep value not sync #110

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/pages/phim/_season.vue
Original file line number Diff line number Diff line change
Expand Up @@ -877,11 +877,16 @@ watchEffect(() => {
})
// TOOD: check chapName in url is chapName
watchEffect(() => {
if (!currentMetaChap.value) return
const chaps = currentDataSeason.value?.chaps
if (!chaps) return

const { chap: epId } = route.params

const metaEp = epId ? chaps.find((item) => item.id === epId) : chaps[0]
if (!metaEp) return

if (!route.params.chap) return // this first chap not need

const correctChapName = parseChapName(currentMetaChap.value.name)
const correctChapName = parseChapName(metaEp.name)
const urlChapName = route.params.chapName

if (urlChapName) {
Expand All @@ -892,7 +897,7 @@ watchEffect(() => {
`chapName wrong current: "${urlChapName}" not equal real: ${correctChapName}.\nAuto edit url to chapName correct`
)
router.replace({
path: `/phim/${route.params.season}/${correctChapName}-${route.params.chap}`,
path: `/phim/${route.params.season}/${correctChapName}-${epId}`,
query: route.query,
hash: route.hash,
})
Expand All @@ -901,7 +906,7 @@ watchEffect(() => {
// replace
console.info("this url old type redirect to new type url")
router.replace({
path: `/phim/${route.params.season}/${correctChapName}-${route.params.chap}`,
path: `/phim/${route.params.season}/${correctChapName}-${epId}`,
query: route.query,
hash: route.hash,
})
Expand Down