mirror of
https://github.com/romancm/gamebrary
synced 2025-02-17 19:48:24 +00:00
update boards store when renaming board
This commit is contained in:
parent
2a82ca3a26
commit
240f4401f4
2 changed files with 10 additions and 0 deletions
|
@ -253,6 +253,10 @@ export default {
|
||||||
|
|
||||||
this.$store.commit('SET_BOARD', payload);
|
this.$store.commit('SET_BOARD', payload);
|
||||||
|
|
||||||
|
if (board.name !== this.name) {
|
||||||
|
this.$store.commit('UPDATE_BOARD_NAME', payload);
|
||||||
|
}
|
||||||
|
|
||||||
await this.$store.dispatch('SAVE_BOARD')
|
await this.$store.dispatch('SAVE_BOARD')
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.saving = false;
|
this.saving = false;
|
||||||
|
|
|
@ -18,6 +18,12 @@ export default {
|
||||||
state.board = board;
|
state.board = board;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
UPDATE_BOARD_NAME(state, updatedBoard) {
|
||||||
|
const board = state.boards.find(({ id }) => updatedBoard.id === id);
|
||||||
|
|
||||||
|
board.name = updatedBoard.name;
|
||||||
|
},
|
||||||
|
|
||||||
SET_GAME_BOARD(state, board) {
|
SET_GAME_BOARD(state, board) {
|
||||||
state.board = board;
|
state.board = board;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue