@@ -1072,6 +1072,22 @@ export default {
|
||||
this.isEditing = true
|
||||
}
|
||||
|
||||
if (mode === 'latest') {
|
||||
let versionList = this.versions
|
||||
if (this.$route.query.loader) {
|
||||
versionList = versionList.filter((x) =>
|
||||
x.loaders.includes(this.$route.query.loader)
|
||||
)
|
||||
}
|
||||
if (this.$route.query.version) {
|
||||
versionList = versionList.filter((x) =>
|
||||
x.game_versions.includes(this.$route.query.version)
|
||||
)
|
||||
}
|
||||
this.version = versionList.reduce((a, b) =>
|
||||
a.date_published > b.date_published ? a : b
|
||||
)
|
||||
} else {
|
||||
this.version = this.versions.find(
|
||||
(x) => x.id === this.$route.params.version
|
||||
)
|
||||
@@ -1096,6 +1112,7 @@ export default {
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.version) {
|
||||
this.$nuxt.context.error({
|
||||
|
||||
10
pages/_type/_id/version/latest.vue
Normal file
10
pages/_type/_id/version/latest.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<div></div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
auth: false,
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
Reference in New Issue
Block a user