fix(ui): wait for podcast object to be available before checking if we can see it

environments/review-docs-2155-h4rhwk/deployments/17666
Kasper Seweryn 2023-06-12 10:31:59 +02:00
rodzic 600746dd73
commit 328ae245b3
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -0,0 +1 @@
Fixed premature login redirect on podcast detail page (#2155)

Wyświetl plik

@ -103,7 +103,8 @@ watch([uuid, object], ([uuid, object], [lastUuid, lastObject]) => {
const route = useRoute()
watchEffect(() => {
if (!store.state.auth.authenticated && store.getters['instance/domain'] !== object.value?.actor.domain) {
if (!object.value) return
if (!store.state.auth.authenticated && store.getters['instance/domain'] !== object.value.actor.domain) {
router.push({ name: 'login', query: { next: route.fullPath } })
}
})