No need to pass in callHandler separately

because session is already passed
This commit is contained in:
RMidhunSuresh 2023-01-24 11:58:49 +05:30
parent fa5cb684b0
commit d2b1fc7fef
No known key found for this signature in database
2 changed files with 3 additions and 5 deletions

View File

@ -49,7 +49,6 @@ export class SessionViewModel extends ViewModel {
this._createRoomViewModel = null;
this._joinRoomViewModel = null;
this._toastCollectionViewModel = this.track(new ToastCollectionViewModel(this.childOptions({
callHandler: this._client.session.callHandler,
session: this._client.session,
})));
this._setupNavigation();

View File

@ -14,16 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import {ObservableArray, ObservableMap} from "../../../observable";
import {ObservableArray} from "../../../observable";
import {ViewModel, Options as BaseOptions} from "../../ViewModel";
import type {GroupCall} from "../../../matrix/calls/group/GroupCall";
import type {Room} from "../../../matrix/room/Room.js";
import type {CallHandler} from "../../../matrix/calls/CallHandler";
import type {Session} from "../../../matrix/Session.js";
import {CallToastNotificationViewModel} from "./CallToastNotificationViewModel";
type Options = {
callHandler: CallHandler;
session: Session;
} & BaseOptions;
@ -32,7 +30,8 @@ export class ToastCollectionViewModel extends ViewModel<Options> {
constructor(options: Options) {
super(options);
const callsObservableMap = this.getOption("callHandler").calls;
const session = this.getOption("session");
const callsObservableMap = session.callHandler.calls;
this.track(callsObservableMap.subscribe(this));
}