diff --git a/src/components/Settings/BoardSettings.vue b/src/components/Settings/BoardSettings.vue index 8521231d..4d14cd59 100644 --- a/src/components/Settings/BoardSettings.vue +++ b/src/components/Settings/BoardSettings.vue @@ -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; diff --git a/src/store/mutations.js b/src/store/mutations.js index 8a13c0ee..872cca5a 100755 --- a/src/store/mutations.js +++ b/src/store/mutations.js @@ -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; },