Accommodate "rightpanel" navigation segment

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-06-17 14:22:48 +05:30
parent 8b01ca502e
commit dfe7385611
3 changed files with 8 additions and 1 deletions

View file

@ -83,6 +83,7 @@ export class RoomGridViewModel extends ViewModel {
let path = this.navigation.path.until("rooms");
path = path.with(this.navigation.segment("room", roomId));
if (detailsShown) {
path = path.with(this.navigation.segment("rightpanel", true));
path = path.with(this.navigation.segment("details", true));
}
this.navigation.applyPath(path);

View file

@ -93,8 +93,13 @@ export class LeftPanelViewModel extends ViewModel {
}
_pathForDetails(path) {
let _path = path;
const details = this.navigation.path.get("details");
return details?.value ? path.with(details) : path;
if (details?.value) {
_path = _path.with(this.navigation.segment("rightpanel"));
_path = _path.with(details)
}
return _path;
}
toggleGrid() {

View file

@ -290,6 +290,7 @@ export class RoomViewModel extends ViewModel {
openDetailsPanel() {
let path = this.navigation.path.until("room");
path = path.with(this.navigation.segment("rightpanel", true));
path = path.with(this.navigation.segment("details", true));
this.navigation.applyPath(path);
}