Inline method

Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
RMidhunSuresh 2021-07-15 23:15:23 +05:30
parent 1f67aa34d3
commit 694b627309

View file

@ -93,25 +93,19 @@ export class LeftPanelViewModel extends ViewModel {
} }
} }
_pathForRightPanel(path) {
let _path = path;
_path = addPanelIfNeeded(this.navigation, _path);
return _path;
}
toggleGrid() { toggleGrid() {
const room = this.navigation.path.get("room"); const room = this.navigation.path.get("room");
let path = this.navigation.path.until("session"); let path = this.navigation.path.until("session");
if (this.gridEnabled) { if (this.gridEnabled) {
if (room) { if (room) {
path = path.with(room); path = path.with(room);
path = this._pathForRightPanel(path); path = addPanelIfNeeded(this.navigation, path);
} }
} else { } else {
if (room) { if (room) {
path = path.with(this.navigation.segment("rooms", [room.value])); path = path.with(this.navigation.segment("rooms", [room.value]));
path = path.with(room); path = path.with(room);
path = this._pathForRightPanel(path); path = addPanelIfNeeded(this.navigation, path);
} else { } else {
path = path.with(this.navigation.segment("rooms", [])); path = path.with(this.navigation.segment("rooms", []));
path = path.with(this.navigation.segment("empty-grid-tile", 0)); path = path.with(this.navigation.segment("empty-grid-tile", 0));