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

computed properties wont get filled at app-start #7

Open
fgerards opened this issue Aug 17, 2020 · 1 comment
Open

computed properties wont get filled at app-start #7

fgerards opened this issue Aug 17, 2020 · 1 comment

Comments

@fgerards
Copy link

fgerards commented Aug 17, 2020

With slower API server connections, the App fatals with errors inside the layouts/defaults.vue component.
Objects like "state.typo3.initial.navigtation[0] are not filled and there is no check to prevent errors on it.
Proposing following changes:

\<template\> \<div v-if="navMain !== null" class="wrapper"\> ... \<div v-if="breadcrumbs !== null" class="border-b mb-20px"\> ... computed: { ...mapState({ navMain: state => state.typo3.initial.navigation ? state.typo3.initial.navigation[0] : null, // get first instance from root tree, breadcrumbs: (state) => state.typo3.page.page ? state.typo3.page.page.breadcrumbs : null, // get breadcrumbs for current page

This secures, that if the without the axios-GET-Request being fired or resolved when component is rendered, the corresponding template parts are not rendered.

@tmotyl
Copy link
Contributor

tmotyl commented Aug 17, 2020

@fgerards can you send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants