Skip to content

Commit

Permalink
Add Settings option to menu when single room mode is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Dec 21, 2022
1 parent 85338f4 commit b7bbfbf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/iframe/views/RoomView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class RoomView extends BaseRoomView {
if (super._optionsPopup && super._optionsPopup.isOpen) {
super._optionsPopup.close();
} else {
const vm = super.value;
const vm: RoomViewModel = super.value;
const options: MenuOption[] = [];
options.push(Menu.option(vm.i18n`Room details`, () => vm.openDetailsPanel()));
if (vm.canLeave) {
Expand All @@ -24,14 +24,22 @@ export class RoomView extends BaseRoomView {
if (vm.canRejoin) {
options.push(Menu.option(vm.i18n`Rejoin room`, () => vm.rejoinRoom()));
}
if (this.isSingleRoomMode(vm)) {
options.push(Menu.option(vm.i18n`Settings`, () => vm.navigation.push("settings")));
}
if (!options.length) {
return;
}

const optionsPopup = new Popup(new Menu(options));
optionsPopup.trackInTemplateView(this);
optionsPopup.showRelativeTo(evt.target, 10);

super._optionsPopup = optionsPopup;
}
}

private isSingleRoomMode(vm: RoomViewModel): boolean {
return !!vm.platform.config.roomId;
}
}

0 comments on commit b7bbfbf

Please sign in to comment.