Make sure no cta's are visible while the page is loading

This commit is contained in:
kolaente 2021-01-20 22:09:40 +01:00
parent 981a230b14
commit 890d9b3f11
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 7 additions and 2 deletions

View file

@ -83,7 +83,7 @@
</p> </p>
</div> </div>
<p class="has-text-centered has-text-grey" v-if="tasks.length === 0"> <p class="has-text-centered has-text-grey" v-if="ctaVisiable && tasks.length === 0 && !taskCollectionService.loading">
This list is currently empty. This list is currently empty.
<a @click="$refs.newTaskInput.focus()">Create a new task.</a> <a @click="$refs.newTaskInput.focus()">Create a new task.</a>
</p> </p>
@ -184,6 +184,8 @@ export default {
showError: false, showError: false,
labelTaskService: LabelTaskService, labelTaskService: LabelTaskService,
labelService: LabelService, labelService: LabelService,
ctaVisible: false,
} }
}, },
mixins: [ mixins: [
@ -207,6 +209,9 @@ export default {
canWrite: state => state.currentList.maxRight > Rights.READ, canWrite: state => state.currentList.maxRight > Rights.READ,
list: state => state.currentList, list: state => state.currentList,
}), }),
mounted() {
this.$nextTick(() => this.ctaVisible = true)
},
methods: { methods: {
// This function initializes the tasks page and loads the first page of tasks // This function initializes the tasks page and loads the first page of tasks
initTasks(page, search = '') { initTasks(page, search = '') {

View file

@ -16,7 +16,7 @@
</router-link> </router-link>
</li> </li>
</ul> </ul>
<p v-else class="has-text-centered has-text-grey"> <p v-else-if="!teamService.loading" class="has-text-centered has-text-grey">
You are currently not part of any teams. You are currently not part of any teams.
<router-link :to="{name: 'teams.create'}"> <router-link :to="{name: 'teams.create'}">
Create a new team. Create a new team.