mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Remove code from session view/vm
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
46a6cf6adf
commit
f3c7ab337d
@ -25,7 +25,6 @@ import {RoomGridViewModel} from "./RoomGridViewModel.js";
|
||||
import {SettingsViewModel} from "./settings/SettingsViewModel.js";
|
||||
import {ViewModel} from "../ViewModel.js";
|
||||
import {RoomViewModelObservable} from "./RoomViewModelObservable.js";
|
||||
import {MemberListViewModel} from "./rightpanel/MemberListViewModel.js";
|
||||
import {RightPanelViewModel} from "./rightpanel/RightPanelViewModel.js";
|
||||
|
||||
export class SessionViewModel extends ViewModel {
|
||||
@ -82,9 +81,6 @@ export class SessionViewModel extends ViewModel {
|
||||
}));
|
||||
this._updateLightbox(lightbox.get());
|
||||
|
||||
// const members = this.navigation.observe("members");
|
||||
// this.track(members.subscribe(() => this._toggleMemberListPanel()));
|
||||
// this._toggleMemberListPanel();
|
||||
|
||||
const rightpanel = this.navigation.observe("rightpanel");
|
||||
this.track(rightpanel.subscribe(() => this._updateRightPanel()));
|
||||
@ -123,9 +119,6 @@ export class SessionViewModel extends ViewModel {
|
||||
return this._roomViewModelObservable?.get();
|
||||
}
|
||||
|
||||
get memberListViewModel() {
|
||||
return this._memberListViewModel;
|
||||
}
|
||||
|
||||
get rightPanelViewModel() {
|
||||
return this._rightPanelViewModel;
|
||||
@ -265,20 +258,6 @@ export class SessionViewModel extends ViewModel {
|
||||
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() {
|
||||
this._rightPanelViewModel = this.disposeTracked(this._rightPanelViewModel);
|
||||
const enable = !!this.navigation.path.get("rightpanel")?.value;
|
||||
|
@ -25,8 +25,6 @@ import {StaticView} from "../general/StaticView.js";
|
||||
import {SessionStatusView} from "./SessionStatusView.js";
|
||||
import {RoomGridView} from "./RoomGridView.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";
|
||||
|
||||
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.`)));
|
||||
}
|
||||
}),
|
||||
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.rightPanelViewModel, rightPanelViewModel => rightPanelViewModel ? new RightPanelView(rightPanelViewModel) : null)
|
||||
]);
|
||||
|
Loading…
Reference in New Issue
Block a user