mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
confirm before clearing
This commit is contained in:
parent
3ab68ef438
commit
7b86b483ed
@ -50,6 +50,12 @@ class SessionPickerItemView extends TemplateView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onClearClick() {
|
||||||
|
if (confirm("Are you sure?")) {
|
||||||
|
this.value.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render(t, vm) {
|
render(t, vm) {
|
||||||
const deleteButton = t.button({
|
const deleteButton = t.button({
|
||||||
className: "destructive",
|
className: "destructive",
|
||||||
@ -58,7 +64,7 @@ class SessionPickerItemView extends TemplateView {
|
|||||||
}, "Sign Out");
|
}, "Sign Out");
|
||||||
const clearButton = t.button({
|
const clearButton = t.button({
|
||||||
disabled: vm => vm.isClearing,
|
disabled: vm => vm.isClearing,
|
||||||
onClick: () => vm.clear(),
|
onClick: this._onClearClick.bind(this),
|
||||||
}, "Clear");
|
}, "Clear");
|
||||||
const exportButton = t.button({
|
const exportButton = t.button({
|
||||||
disabled: vm => vm.isClearing,
|
disabled: vm => vm.isClearing,
|
||||||
|
Loading…
Reference in New Issue
Block a user