mirror of
https://github.com/romancm/gamebrary
synced 2024-11-28 14:10:26 +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);
|
||||
|
||||
if (board.name !== this.name) {
|
||||
this.$store.commit('UPDATE_BOARD_NAME', payload);
|
||||
}
|
||||
|
||||
await this.$store.dispatch('SAVE_BOARD')
|
||||
.catch(() => {
|
||||
this.saving = false;
|
||||
|
|
|
@ -18,6 +18,12 @@ export default {
|
|||
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) {
|
||||
state.board = board;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue