change route after board duplication

Signed-off-by: Jakob <jakob.roehrl@web.de>
This commit is contained in:
Jakob
2019-10-09 08:42:28 +02:00
parent 31ae00708d
commit 71e7c98fd6
5 changed files with 25 additions and 15 deletions

View File

@@ -131,16 +131,20 @@ export default {
})
actions.push({
action: () => {
action: async () => {
this.hideMenu()
this.loading = true
this.$store.dispatch('cloneBoard', this.board).then((newBoard) => {
try {
const newBoard = await this.$store.dispatch('cloneBoard', this.board)
this.loading = false
this.editTitle = this.board.title
this.editColor = '#' + this.board.color
this.editing = true
})
const route = this.routeTo
route.params.id = newBoard.id
this.$router.push(route)
}
catch {
OC.Notification.showTemporary(t('deck', 'An error occurred'))
}
},
icon: 'icon-clone',
text: t('deck', 'Clone board')