Fix rebase again

This commit is contained in:
RMidhunSuresh 2023-03-28 16:52:25 +05:30
parent 53c0fc2934
commit 6e2cd3597f
4 changed files with 19 additions and 12 deletions

View File

@ -32,11 +32,13 @@ export class VerificationToastCollectionViewModel extends ViewModel<SegmentType,
constructor(options: Options) {
super(options);
this.track(
options.session.crossSigning.subscribe((crossSigning) => {
this.subscribeToSASRequests();
}
private async subscribeToSASRequests() {
await this.getOption("session").crossSigning.waitFor(v => !!v).promise;
const crossSigning = this.getOption("session").crossSigning.get();
this.track(crossSigning.receivedSASVerifications.subscribe(this));
})
);
}

View File

@ -365,6 +365,7 @@ export class Session {
olm: this._olm,
olmUtil: this._olmUtil,
deviceTracker: this._deviceTracker,
deviceMessageHandler: this._deviceMessageHandler,
hsApi: this._hsApi,
ownUserId: this.userId,
e2eeAccount: this._e2eeAccount

View File

@ -86,7 +86,11 @@ export class SelectVerificationMethodStage extends BaseSASVerificationStage {
private async findDeviceName(log: ILogItem) {
await log.wrap("SelectVerificationMethodStage.findDeviceName", async () => {
const device = await this.options.deviceTracker.deviceForId(this.otherUserId, this.otherUserDeviceId, this.options.hsApi, log);
this.otherDeviceName = device.displayName;
if (!device) {
log.log({ l: "Cannot find device", userId: this.otherUserId, deviceId: this.otherUserDeviceId });
throw new Error("Cannot find device");
}
this.otherDeviceName = device.unsigned.device_display_name ?? device.device_id;
})
}

View File

@ -37,13 +37,13 @@ function toastViewModelToView(vm: BaseToastNotificationViewModel): IView {
export class ToastCollectionView extends TemplateView<ToastCollectionViewModel> {
render(t: Builder<ToastCollectionViewModel>, vm: ToastCollectionViewModel) {
const view = new ListView({
return t.div({ className: "ToastCollectionView" }, [
t.ifView(vm => !!vm.toastViewModels, t => {
return new ListView({
list: vm.toastViewModels,
parentProvidesUpdates: false,
}, (vm: CallToastNotificationViewModel) => toastViewModelToView(vm));
return t.div({ className: "ToastCollectionView" }, [
t.if(vm => !!vm.toastViewModels, (t) => t.view(view)),
}),
]);
}
}