mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Merge pull request #409 from vector-im/bwindels/confirm-leave
confirm the leave room
This commit is contained in:
commit
7177fc1a03
@ -70,7 +70,7 @@ export class RoomView extends TemplateView {
|
|||||||
const options = [];
|
const options = [];
|
||||||
options.push(Menu.option(vm.i18n`Room details`, () => vm.openDetailsPanel()))
|
options.push(Menu.option(vm.i18n`Room details`, () => vm.openDetailsPanel()))
|
||||||
if (vm.canLeave) {
|
if (vm.canLeave) {
|
||||||
options.push(Menu.option(vm.i18n`Leave room`, () => vm.leaveRoom()).setDestructive());
|
options.push(Menu.option(vm.i18n`Leave room`, () => this._confirmToLeaveRoom()).setDestructive());
|
||||||
}
|
}
|
||||||
if (vm.canForget) {
|
if (vm.canForget) {
|
||||||
options.push(Menu.option(vm.i18n`Forget room`, () => vm.forgetRoom()).setDestructive());
|
options.push(Menu.option(vm.i18n`Forget room`, () => vm.forgetRoom()).setDestructive());
|
||||||
@ -97,4 +97,10 @@ export class RoomView extends TemplateView {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_confirmToLeaveRoom() {
|
||||||
|
if (confirm(this.value.i18n`Are you sure you want to leave "${this.value.name}"?`)) {
|
||||||
|
this.value.leaveRoom();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user