fix: load the list tasks only after the list itself was loaded
This commit is contained in:
parent
7e8e26679c
commit
faf8f2b1a5
|
@ -166,6 +166,11 @@ store.dispatch('labels/loadAllLabels')
|
||||||
padding: $navbar-height + 1.5rem 1.5rem 1rem 1.5rem;
|
padding: $navbar-height + 1.5rem 1.5rem 1rem 1.5rem;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
|
// Used to make sure the spinner is always in the middle while loading
|
||||||
|
> .loader-container {
|
||||||
|
min-height: calc(100vh - #{$navbar-height + 1.5rem + 1rem});
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: $tablet) {
|
@media screen and (max-width: $tablet) {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
padding-top: 1.5rem;
|
padding-top: 1.5rem;
|
||||||
|
|
|
@ -41,17 +41,17 @@
|
||||||
</message>
|
</message>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
<router-view/>
|
<router-view v-if="listLoaded"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Message from '@/components/misc/message'
|
import Message from '@/components/misc/message'
|
||||||
import ListModel from '../../models/list'
|
import ListModel from '@/models/list'
|
||||||
import ListService from '../../services/list'
|
import ListService from '@/services/list'
|
||||||
import {CURRENT_LIST} from '../../store/mutation-types'
|
import {CURRENT_LIST, BACKGROUND} from '@/store/mutation-types'
|
||||||
import {getListView} from '../../helpers/saveListView'
|
import {getListView} from '@/helpers/saveListView'
|
||||||
import {saveListToHistory} from '../../modules/listHistory'
|
import {saveListToHistory} from '@/modules/listHistory'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {Message},
|
components: {Message},
|
||||||
|
@ -96,6 +96,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.listLoaded = 0
|
||||||
const listData = {id: parseInt(this.$route.params.listId)}
|
const listData = {id: parseInt(this.$route.params.listId)}
|
||||||
|
|
||||||
saveListToHistory(listData)
|
saveListToHistory(listData)
|
||||||
|
@ -145,6 +146,13 @@ export default {
|
||||||
|
|
||||||
console.debug(`Loading list, $route.name = ${this.$route.name}, $route.params =`, this.$route.params, `, listLoaded = ${this.listLoaded}, currentList = `, this.currentList)
|
console.debug(`Loading list, $route.name = ${this.$route.name}, $route.params =`, this.$route.params, `, listLoaded = ${this.listLoaded}, currentList = `, this.currentList)
|
||||||
|
|
||||||
|
// Put set the current list to the one we're about to load so that the title is already shown at the top
|
||||||
|
const listFromStore = this.$store.getters['lists/getListById'](listData.id)
|
||||||
|
if (listFromStore !== null) {
|
||||||
|
this.$store.commit(BACKGROUND, null)
|
||||||
|
this.$store.commit(CURRENT_LIST, listFromStore)
|
||||||
|
}
|
||||||
|
|
||||||
// We create an extra list object instead of creating it in this.list because that would trigger a ui update which would result in bad ux.
|
// We create an extra list object instead of creating it in this.list because that would trigger a ui update which would result in bad ux.
|
||||||
const list = new ListModel(listData)
|
const list = new ListModel(listData)
|
||||||
try {
|
try {
|
||||||
|
|
Reference in New Issue
Block a user