From 0e44cce2d9cf6b933015918a07e388865374c5b1 Mon Sep 17 00:00:00 2001 From: Baptiste Grob <60621355+baptiste-grob@users.noreply.github.com> Date: Tue, 14 Jul 2020 17:02:53 +0200 Subject: [PATCH] fix: broken AlertService call --- .../javascripts/views/tags/tags_view.ts | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/views/tags/tags_view.ts b/app/assets/javascripts/views/tags/tags_view.ts index c3cbb151f..964760136 100644 --- a/app/assets/javascripts/views/tags/tags_view.ts +++ b/app/assets/javascripts/views/tags/tags_view.ts @@ -17,6 +17,7 @@ import { STRING_DELETE_TAG } from '@/strings'; import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl'; import { UuidString } from '@node_modules/snjs/dist/@types/types'; import { TagMutator } from '@node_modules/snjs/dist/@types/models/app/tag'; +import { confirmDialog } from '@/services/alertService'; type NoteCounts = Partial> @@ -370,20 +371,14 @@ class TagsViewCtrl extends PureViewCtrl { this.removeTag(tag); } - removeTag(tag: SNTag) { - this.application.alertService!.confirm( - STRING_DELETE_TAG, - undefined, - undefined, - undefined, - () => { - /* On confirm */ - this.application.deleteItem(tag); - this.selectTag(this.getState().smartTags[0]); - }, - undefined, - true, - ); + async removeTag(tag: SNTag) { + if (await confirmDialog({ + text: STRING_DELETE_TAG, + confirmButtonStyle: 'danger' + })) { + this.application.deleteItem(tag); + this.selectTag(this.getState().smartTags[0]); + } } }