mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
dispose session container from view model
This commit is contained in:
parent
d48bbd122a
commit
0f8f558889
@ -25,14 +25,14 @@ export class SessionViewModel extends ViewModel {
|
|||||||
constructor(options) {
|
constructor(options) {
|
||||||
super(options);
|
super(options);
|
||||||
const {sessionContainer} = options;
|
const {sessionContainer} = options;
|
||||||
this._session = sessionContainer.session;
|
this._sessionContainer = this.track(sessionContainer);
|
||||||
this._sessionStatusViewModel = this.track(new SessionStatusViewModel(this.childOptions({
|
this._sessionStatusViewModel = this.track(new SessionStatusViewModel(this.childOptions({
|
||||||
sync: sessionContainer.sync,
|
sync: sessionContainer.sync,
|
||||||
reconnector: sessionContainer.reconnector,
|
reconnector: sessionContainer.reconnector,
|
||||||
session: sessionContainer.session,
|
session: sessionContainer.session,
|
||||||
})));
|
})));
|
||||||
this._leftPanelViewModel = new LeftPanelViewModel(this.childOptions({
|
this._leftPanelViewModel = new LeftPanelViewModel(this.childOptions({
|
||||||
rooms: this._session.rooms,
|
rooms: this._sessionContainer.session.rooms,
|
||||||
openRoom: this._openRoom.bind(this),
|
openRoom: this._openRoom.bind(this),
|
||||||
gridEnabled: {
|
gridEnabled: {
|
||||||
get: () => !!this._gridViewModel,
|
get: () => !!this._gridViewModel,
|
||||||
@ -116,7 +116,7 @@ export class SessionViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
const roomVM = new RoomViewModel(this.childOptions({
|
const roomVM = new RoomViewModel(this.childOptions({
|
||||||
room,
|
room,
|
||||||
ownUserId: this._session.user.id,
|
ownUserId: this._sessionContainer.session.user.id,
|
||||||
closeCallback: () => {
|
closeCallback: () => {
|
||||||
if (this._closeCurrentRoom()) {
|
if (this._closeCurrentRoom()) {
|
||||||
this.emitChange("currentRoom");
|
this.emitChange("currentRoom");
|
||||||
|
Loading…
Reference in New Issue
Block a user