From 7b86b483ed4c005691138725934b305aa6a9e3a1 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 9 Oct 2020 17:02:19 +0200 Subject: [PATCH] confirm before clearing --- src/ui/web/login/SessionPickerView.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/web/login/SessionPickerView.js b/src/ui/web/login/SessionPickerView.js index 420a151f..e421e56c 100644 --- a/src/ui/web/login/SessionPickerView.js +++ b/src/ui/web/login/SessionPickerView.js @@ -50,6 +50,12 @@ class SessionPickerItemView extends TemplateView { } } + _onClearClick() { + if (confirm("Are you sure?")) { + this.value.clear(); + } + } + render(t, vm) { const deleteButton = t.button({ className: "destructive", @@ -58,7 +64,7 @@ class SessionPickerItemView extends TemplateView { }, "Sign Out"); const clearButton = t.button({ disabled: vm => vm.isClearing, - onClick: () => vm.clear(), + onClick: this._onClearClick.bind(this), }, "Clear"); const exportButton = t.button({ disabled: vm => vm.isClearing,