From 49a8ca6f224751fd478b8b590579e43c558ef196 Mon Sep 17 00:00:00 2001 From: Ishant Date: Mon, 20 Apr 2020 05:11:11 +0530 Subject: [PATCH] removed extra lines Signed-off-by: Ishant --- .../navigation/AppNavigationBoard.vue | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index 8f9ab828c..8f338a808 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -189,16 +189,32 @@ export default { actions.push({ action: () => { - this.hideMenu() - this.loading = true - this.boardApi.deleteBoard(this.board) - .then(() => { - this.loading = false - this.deleted = true - this.undoTimeoutHandle = setTimeout(() => { - this.$store.dispatch('removeBoard', this.board) - }, 7000) - }) + OC.dialogs.confirmDestructive( + t('deck', 'Are you sure you want to delete the board {title}? This will delete all the data of this board.', { title: this.board.title }), + t('deck', 'Delete the board?'), + { + type: OC.dialogs.YES_NO_BUTTONS, + confirm: t('deck', 'Delete'), + confirmClasses: 'error', + cancel: t('deck', 'Cancel'), + }, + (result) => { + if (result) { + this.hideMenu() + this.loading = true + this.boardApi.deleteBoard(this.board) + .then(() => { + this.loading = false + this.deleted = true + this.undoTimeoutHandle = setTimeout(() => { + this.$store.dispatch('removeBoard', this.board) + }, 7000) + }) + } + }, + true + ) + }, icon: 'icon-delete', text: t('deck', 'Delete board'),