Remove code from session view/vm
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
46a6cf6adf
commit
f3c7ab337d
2 changed files with 1 additions and 25 deletions
|
@ -25,7 +25,6 @@ import {RoomGridViewModel} from "./RoomGridViewModel.js";
|
||||||
import {SettingsViewModel} from "./settings/SettingsViewModel.js";
|
import {SettingsViewModel} from "./settings/SettingsViewModel.js";
|
||||||
import {ViewModel} from "../ViewModel.js";
|
import {ViewModel} from "../ViewModel.js";
|
||||||
import {RoomViewModelObservable} from "./RoomViewModelObservable.js";
|
import {RoomViewModelObservable} from "./RoomViewModelObservable.js";
|
||||||
import {MemberListViewModel} from "./rightpanel/MemberListViewModel.js";
|
|
||||||
import {RightPanelViewModel} from "./rightpanel/RightPanelViewModel.js";
|
import {RightPanelViewModel} from "./rightpanel/RightPanelViewModel.js";
|
||||||
|
|
||||||
export class SessionViewModel extends ViewModel {
|
export class SessionViewModel extends ViewModel {
|
||||||
|
@ -82,9 +81,6 @@ export class SessionViewModel extends ViewModel {
|
||||||
}));
|
}));
|
||||||
this._updateLightbox(lightbox.get());
|
this._updateLightbox(lightbox.get());
|
||||||
|
|
||||||
// const members = this.navigation.observe("members");
|
|
||||||
// this.track(members.subscribe(() => this._toggleMemberListPanel()));
|
|
||||||
// this._toggleMemberListPanel();
|
|
||||||
|
|
||||||
const rightpanel = this.navigation.observe("rightpanel");
|
const rightpanel = this.navigation.observe("rightpanel");
|
||||||
this.track(rightpanel.subscribe(() => this._updateRightPanel()));
|
this.track(rightpanel.subscribe(() => this._updateRightPanel()));
|
||||||
|
@ -123,9 +119,6 @@ export class SessionViewModel extends ViewModel {
|
||||||
return this._roomViewModelObservable?.get();
|
return this._roomViewModelObservable?.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
get memberListViewModel() {
|
|
||||||
return this._memberListViewModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
get rightPanelViewModel() {
|
get rightPanelViewModel() {
|
||||||
return this._rightPanelViewModel;
|
return this._rightPanelViewModel;
|
||||||
|
@ -265,20 +258,6 @@ export class SessionViewModel extends ViewModel {
|
||||||
return room;
|
return room;
|
||||||
}
|
}
|
||||||
|
|
||||||
async _toggleMemberListPanel() {
|
|
||||||
this._memberListViewModel = this.disposeTracked(this._memberListViewModel);
|
|
||||||
const enable = !!this.navigation.path.get("members")?.value;
|
|
||||||
if (enable) {
|
|
||||||
const room = this._roomFromNavigation();
|
|
||||||
const list = await room.loadMemberList();
|
|
||||||
const members = list.members;
|
|
||||||
this._memberListViewModel = this.track(
|
|
||||||
new MemberListViewModel(this.childOptions({members}))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
this.emitChange("memberListViewModel");
|
|
||||||
}
|
|
||||||
|
|
||||||
_updateRightPanel() {
|
_updateRightPanel() {
|
||||||
this._rightPanelViewModel = this.disposeTracked(this._rightPanelViewModel);
|
this._rightPanelViewModel = this.disposeTracked(this._rightPanelViewModel);
|
||||||
const enable = !!this.navigation.path.get("rightpanel")?.value;
|
const enable = !!this.navigation.path.get("rightpanel")?.value;
|
||||||
|
|
|
@ -25,8 +25,6 @@ import {StaticView} from "../general/StaticView.js";
|
||||||
import {SessionStatusView} from "./SessionStatusView.js";
|
import {SessionStatusView} from "./SessionStatusView.js";
|
||||||
import {RoomGridView} from "./RoomGridView.js";
|
import {RoomGridView} from "./RoomGridView.js";
|
||||||
import {SettingsView} from "./settings/SettingsView.js";
|
import {SettingsView} from "./settings/SettingsView.js";
|
||||||
import {RoomDetailsView} from "./rightpanel/RoomDetailsView.js";
|
|
||||||
import {MemberListView} from "./rightpanel/MemberListView.js";
|
|
||||||
import {RightPanelView} from "./rightpanel/RightPanelView.js";
|
import {RightPanelView} from "./rightpanel/RightPanelView.js";
|
||||||
|
|
||||||
export class SessionView extends TemplateView {
|
export class SessionView extends TemplateView {
|
||||||
|
@ -57,7 +55,6 @@ export class SessionView extends TemplateView {
|
||||||
return new StaticView(t => t.div({className: "room-placeholder"}, t.h2(vm.i18n`Choose a room on the left side.`)));
|
return new StaticView(t => t.div({className: "room-placeholder"}, t.h2(vm.i18n`Choose a room on the left side.`)));
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
t.mapView(vm => vm.memberListViewModel, memberListViewModel => memberListViewModel ? new MemberListView(memberListViewModel) : null),
|
|
||||||
t.mapView(vm => vm.lightboxViewModel, lightboxViewModel => lightboxViewModel ? new LightboxView(lightboxViewModel) : null),
|
t.mapView(vm => vm.lightboxViewModel, lightboxViewModel => lightboxViewModel ? new LightboxView(lightboxViewModel) : null),
|
||||||
t.mapView(vm => vm.rightPanelViewModel, rightPanelViewModel => rightPanelViewModel ? new RightPanelView(rightPanelViewModel) : null)
|
t.mapView(vm => vm.rightPanelViewModel, rightPanelViewModel => rightPanelViewModel ? new RightPanelView(rightPanelViewModel) : null)
|
||||||
]);
|
]);
|
||||||
|
|
Reference in a new issue