fix: don't try to load lists after logging out

Resolves https://kolaente.dev/vikunja/frontend/issues/329
This commit is contained in:
kolaente 2022-07-21 15:53:08 +02:00
parent 0fe2a16a7c
commit 4c560f1a03
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -76,12 +76,16 @@ const welcome = useDateTimeSalutation()
const store = useStore() const store = useStore()
const listHistory = computed(() => { const listHistory = computed(() => {
// If we don't check this, it tries to load the list background right after logging out
if(!store.state.auth.authenticated) {
return []
}
return getHistory() return getHistory()
.map(l => store.getters['lists/getListById'](l.id)) .map(l => store.getters['lists/getListById'](l.id))
.filter(l => l !== null) .filter(l => l !== null)
}) })
const migratorsEnabled = computed(() => store.state.config.availableMigrators?.length > 0) const migratorsEnabled = computed(() => store.state.config.availableMigrators?.length > 0)
const userInfo = computed(() => store.state.auth.info) const userInfo = computed(() => store.state.auth.info)
const hasTasks = computed(() => store.state.hasTasks) const hasTasks = computed(() => store.state.hasTasks)