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"); let path = this.navigation.path.until("rooms");
path = path.with(this.navigation.segment("room", roomId)); path = path.with(this.navigation.segment("room", roomId));
if (detailsShown) { if (detailsShown) {
path = path.with(this.navigation.segment("rightpanel", true));
path = path.with(this.navigation.segment("details", true)); path = path.with(this.navigation.segment("details", true));
} }
this.navigation.applyPath(path); this.navigation.applyPath(path);

View File

@ -93,8 +93,13 @@ export class LeftPanelViewModel extends ViewModel {
} }
_pathForDetails(path) { _pathForDetails(path) {
let _path = path;
const details = this.navigation.path.get("details"); 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() { toggleGrid() {

View File

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