forked from mystiq/hydrogen-web
Add links
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
fe6551ff3c
commit
f9b1068bae
2 changed files with 12 additions and 4 deletions
|
@ -25,7 +25,7 @@ export class MemberDetailsViewModel extends ViewModel {
|
|||
this._member = this._observableMember.get();
|
||||
this._isEncrypted = options.isEncrypted;
|
||||
this._powerLevelsObservable = options.powerLevelsObservable;
|
||||
this._powerLevel = this._powerLevelFromObservable(this._powerLevelsObservable);
|
||||
this._powerLevel = this._powerLevelsObservable.get().getUserLevel(this._member.userId);
|
||||
this.track(this._powerLevelsObservable.subscribe(() => this._onPowerLevelsChange()));
|
||||
this.track(this._observableMember.subscribe( () => this._onMemberChange()));
|
||||
}
|
||||
|
@ -72,4 +72,12 @@ export class MemberDetailsViewModel extends ViewModel {
|
|||
get isEncrypted() {
|
||||
return this._isEncrypted;
|
||||
}
|
||||
|
||||
get dmLink() {
|
||||
return `${this.urlCreator.urlUntilSegment("session")}/open-room/${this._member.userId}`;
|
||||
}
|
||||
|
||||
get linkToUser() {
|
||||
return `https://matrix.to/#/${this._member.userId}`;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,8 @@ export class MemberDetailsView extends TemplateView {
|
|||
t.div({className: "MemberDetailsView_label"}, vm.i18n`OPTIONS`),
|
||||
t.div({className: "MemberDetailsView_options"},
|
||||
[
|
||||
t.a({href: "#"}, vm.i18n`Direct Message`),
|
||||
t.a({href: "#"}, vm.i18n`Open Link to User`)
|
||||
t.a({href: vm.dmLink}, vm.i18n`Direct Message`),
|
||||
t.a({href: vm.linkToUser, target: "_blank", rel: "noopener"}, vm.i18n`Open Link to User`)
|
||||
])
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue