forked from vikunja/frontend
Compare commits
3 Commits
main
...
fix/load-l
Author | SHA1 | Date | |
---|---|---|---|
9c1464381c | |||
fc62016130 | |||
faf8f2b1a5 |
|
@ -166,6 +166,11 @@ store.dispatch('labels/loadAllLabels')
|
|||
padding: $navbar-height + 1.5rem 1.5rem 1rem 1.5rem;
|
||||
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) {
|
||||
margin-left: 0;
|
||||
padding-top: 1.5rem;
|
||||
|
|
|
@ -41,17 +41,17 @@
|
|||
</message>
|
||||
</transition>
|
||||
|
||||
<router-view/>
|
||||
<router-view v-if="listLoaded"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Message from '@/components/misc/message'
|
||||
import ListModel from '../../models/list'
|
||||
import ListService from '../../services/list'
|
||||
import {CURRENT_LIST} from '../../store/mutation-types'
|
||||
import {getListView} from '../../helpers/saveListView'
|
||||
import {saveListToHistory} from '../../modules/listHistory'
|
||||
import ListModel from '@/models/list'
|
||||
import ListService from '@/services/list'
|
||||
import {CURRENT_LIST, BACKGROUND} from '@/store/mutation-types'
|
||||
import {getListView} from '@/helpers/saveListView'
|
||||
import {saveListToHistory} from '@/modules/listHistory'
|
||||
|
||||
export default {
|
||||
components: {Message},
|
||||
|
@ -145,6 +145,14 @@ export default {
|
|||
|
||||
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
|
||||
this.listLoaded = 0
|
||||
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.
|
||||
const list = new ListModel(listData)
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue
Block a user