mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
fix routing for query params
This commit is contained in:
parent
7b0c327803
commit
543b936c12
3 changed files with 11 additions and 5 deletions
|
|
@ -6,17 +6,23 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { watchImmediate } from '@vueuse/core'
|
||||
|
||||
const route = useRoute('/libraries/[id]')
|
||||
const router = useRouter()
|
||||
const libraryId = computed(() => route.params.id)
|
||||
|
||||
//TODO: for now we always redirect to 'recommended', this should be persisted per libraryId
|
||||
watch(libraryId, () => {
|
||||
void router.push({ name: '/libraries/[id]/recommended', params: { id: libraryId.value } })
|
||||
watchImmediate(libraryId, () => {
|
||||
void router.replace({
|
||||
name: '/libraries/[id]/series',
|
||||
params: { id: libraryId.value },
|
||||
query: route.query,
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<route lang="yaml">
|
||||
meta:
|
||||
requiresRole: ADMIN
|
||||
requiresRole: USER
|
||||
</route>
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ async function submitForm() {
|
|||
rememberMe: appStore.rememberMe,
|
||||
})
|
||||
.then(() => {
|
||||
if (route.query.redirect) void router.push({ path: route.query.redirect.toString() })
|
||||
if (route.query.redirect) void router.push(route.query.redirect.toString())
|
||||
else void router.push('/')
|
||||
})
|
||||
.catch((error) => {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ async function checkAuthenticated() {
|
|||
if (claimError.value) {
|
||||
await router.push({ name: '/error' })
|
||||
} else if (data.value) {
|
||||
if (route.query.redirect) await router.push({ path: route.query.redirect.toString() })
|
||||
if (route.query.redirect) await router.push(route.query.redirect.toString())
|
||||
else await router.push('/')
|
||||
} else if (error.value) {
|
||||
if (claimData.value?.isClaimed)
|
||||
|
|
|
|||
Loading…
Reference in a new issue