mirror of
https://github.com/romancm/gamebrary
synced 2024-11-28 14:10:26 +00:00
refactor list tweaks
This commit is contained in:
parent
90bc7bafb8
commit
babe9bd806
3 changed files with 17 additions and 15 deletions
|
@ -11,7 +11,7 @@
|
|||
<sort-list :list="list" :list-index="listIndex" />
|
||||
<rename-list :list="list" :list-index="listIndex" />
|
||||
<change-list-view :list="list" :list-index="listIndex" />
|
||||
<!-- <list-tweaks :list-index="listIndex" /> -->
|
||||
<list-tweaks :list="list" :list-index="listIndex" />
|
||||
|
||||
<b-dropdown-divider />
|
||||
|
||||
|
|
|
@ -56,11 +56,8 @@ import { mapState } from 'vuex';
|
|||
|
||||
export default {
|
||||
props: {
|
||||
listIndex: {
|
||||
type: Number,
|
||||
required: true,
|
||||
default: 0,
|
||||
},
|
||||
listIndex: Number,
|
||||
list: Object,
|
||||
},
|
||||
|
||||
data() {
|
||||
|
@ -96,7 +93,7 @@ export default {
|
|||
showGameNotes,
|
||||
showGameTags,
|
||||
showGameCount,
|
||||
} = this.gameLists[this.platform.code][this.listIndex];
|
||||
} = this.list.settings;
|
||||
|
||||
this.showReleaseDates = showReleaseDates || false;
|
||||
this.showGameRatings = showGameRatings || false;
|
||||
|
@ -107,18 +104,19 @@ export default {
|
|||
},
|
||||
|
||||
async save() {
|
||||
const { listIndex, list: { settings } } = this;
|
||||
this.saving = true;
|
||||
|
||||
const gameLists = JSON.parse(JSON.stringify(this.gameLists));
|
||||
settings.showReleaseDates = this.showReleaseDates;
|
||||
settings.showGameRatings = this.showGameRatings;
|
||||
settings.showGameProgress = this.showGameProgress;
|
||||
settings.showGameNotes = this.showGameNotes;
|
||||
settings.showGameTags = this.showGameTags;
|
||||
settings.showGameCount = this.showGameCount;
|
||||
|
||||
gameLists[this.platform.code][this.listIndex].showReleaseDates = this.showReleaseDates;
|
||||
gameLists[this.platform.code][this.listIndex].showGameRatings = this.showGameRatings;
|
||||
gameLists[this.platform.code][this.listIndex].showGameProgress = this.showGameProgress;
|
||||
gameLists[this.platform.code][this.listIndex].showGameNotes = this.showGameNotes;
|
||||
gameLists[this.platform.code][this.listIndex].showGameTags = this.showGameTags;
|
||||
gameLists[this.platform.code][this.listIndex].showGameCount = this.showGameCount;
|
||||
this.$store.commit('SET_LIST_SETTINGS', { listIndex, settings });
|
||||
|
||||
await this.$store.dispatch('SAVE_LIST_LEGACY', gameLists)
|
||||
await this.$store.dispatch('SAVE_BOARD')
|
||||
.catch(() => {
|
||||
this.saving = false;
|
||||
|
||||
|
|
|
@ -61,6 +61,10 @@ export default {
|
|||
Vue.set(state.board.lists[listIndex].settings, 'view', view);
|
||||
},
|
||||
|
||||
SET_LIST_SETTINGS(state, { listIndex, settings }) {
|
||||
Vue.set(state.board.lists[listIndex], 'settings', settings);
|
||||
},
|
||||
|
||||
RENAME_LIST(state, { listIndex, listName }) {
|
||||
state.board.lists[listIndex].name = listName;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue