Fix loading a list when it was already partially saved in vuex
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2021-07-10 12:45:36 +02:00
parent a6842d959b
commit 7fa94a9bd5
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 11 additions and 7 deletions

View File

@ -116,7 +116,7 @@ export const store = new Vuex.Store({
// Server updates don't return the right. Therefore the right is reset after updating the list which is
// confusing because all the buttons will disappear in that case. To prevent this, we're keeping the right
// when updating the list in global state.
if (typeof state.currentList.maxRight !== 'undefined') {
if (typeof state.currentList.maxRight !== 'undefined' && (typeof currentList.maxRight === 'undefined' || currentList.maxRight === null)) {
currentList.maxRight = state.currentList.maxRight
}
state.currentList = currentList

View File

@ -89,7 +89,7 @@ export default {
return
},
loadList() {
if(this.$route.name.includes('.settings.')) {
if (this.$route.name.includes('.settings.')) {
return
}
@ -116,12 +116,16 @@ export default {
return this.replaceListView()
}
// Don't load the list if we either already loaded it or aren't dealing with a list at all currently
// Don't load the list if we either already loaded it or aren't dealing with a list at all currently and
// the currently loaded list has the right set.
if (
this.$route.params.listId === this.listLoaded ||
typeof this.$route.params.listId === 'undefined' ||
this.$route.params.listId === this.currentList.id ||
parseInt(this.$route.params.listId) === this.currentList.id
(
this.$route.params.listId === this.listLoaded ||
typeof this.$route.params.listId === 'undefined' ||
this.$route.params.listId === this.currentList.id ||
parseInt(this.$route.params.listId) === this.currentList.id
)
&& typeof this.currentList !== 'undefined' && this.currentList.maxRight !== null
) {
return
}