mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-08 18:48:18 +01:00
crossSigning is an observable value now
This commit is contained in:
parent
90faad551a
commit
d170c6f787
@ -30,6 +30,9 @@ export class MemberDetailsViewModel extends ViewModel {
|
|||||||
this._session = options.session;
|
this._session = options.session;
|
||||||
this.track(this._powerLevelsObservable.subscribe(() => this._onPowerLevelsChange()));
|
this.track(this._powerLevelsObservable.subscribe(() => this._onPowerLevelsChange()));
|
||||||
this.track(this._observableMember.subscribe( () => this._onMemberChange()));
|
this.track(this._observableMember.subscribe( () => this._onMemberChange()));
|
||||||
|
this.track(this._session.crossSigning.subscribe(() => {
|
||||||
|
this.emitChange("isTrusted");
|
||||||
|
}));
|
||||||
this._userTrust = undefined;
|
this._userTrust = undefined;
|
||||||
this.init(); // TODO: call this from parent view model and do something smart with error view model if it fails async?
|
this.init(); // TODO: call this from parent view model and do something smart with error view model if it fails async?
|
||||||
}
|
}
|
||||||
@ -37,7 +40,7 @@ export class MemberDetailsViewModel extends ViewModel {
|
|||||||
async init() {
|
async init() {
|
||||||
if (this.features.crossSigning) {
|
if (this.features.crossSigning) {
|
||||||
this._userTrust = await this.logger.run({l: "MemberDetailsViewModel.get user trust", id: this._member.userId}, log => {
|
this._userTrust = await this.logger.run({l: "MemberDetailsViewModel.get user trust", id: this._member.userId}, log => {
|
||||||
return this._session.crossSigning.getUserTrust(this._member.userId, log);
|
return this._session.crossSigning.get()?.getUserTrust(this._member.userId, log);
|
||||||
});
|
});
|
||||||
this.emitChange("isTrusted");
|
this.emitChange("isTrusted");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user