mirror of
https://github.com/nextcloud/server.git
synced 2026-02-27 20:10:37 -05:00
fix(status): Fix infinite loading of predefined statuses
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
This commit is contained in:
parent
76c58a302a
commit
e2b377f85c
2 changed files with 9 additions and 12 deletions
|
|
@ -20,7 +20,7 @@
|
|||
-->
|
||||
|
||||
<template>
|
||||
<div v-if="hasLoaded"
|
||||
<div v-if="statusesHaveLoaded"
|
||||
class="predefined-statuses-list">
|
||||
<PredefinedStatus v-for="status in predefinedStatuses"
|
||||
:key="status.id"
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
<script>
|
||||
import PredefinedStatus from './PredefinedStatus.vue'
|
||||
import { mapState } from 'vuex'
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'PredefinedStatusesList',
|
||||
|
|
@ -49,20 +49,13 @@ export default {
|
|||
...mapState({
|
||||
predefinedStatuses: state => state.predefinedStatuses.predefinedStatuses,
|
||||
}),
|
||||
/**
|
||||
* Indicator whether the predefined statuses have already been loaded
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
hasLoaded() {
|
||||
return this.predefinedStatuses.length > 0
|
||||
},
|
||||
...mapGetters(['statusesHaveLoaded']),
|
||||
},
|
||||
/**
|
||||
* Loads all predefined statuses from the server
|
||||
* when this component is mounted
|
||||
*/
|
||||
mounted() {
|
||||
created() {
|
||||
this.$store.dispatch('loadAllPredefinedStatuses')
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,11 @@ const mutations = {
|
|||
},
|
||||
}
|
||||
|
||||
const getters = {}
|
||||
const getters = {
|
||||
statusesHaveLoaded(state) {
|
||||
return state.predefinedStatuses.length > 0
|
||||
},
|
||||
}
|
||||
|
||||
const actions = {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue