forked from mystiq/hydrogen-web
show encrypted status of room
This commit is contained in:
parent
0e3084cce3
commit
843e3e6b1c
3 changed files with 10 additions and 2 deletions
|
@ -90,6 +90,10 @@ export class RoomViewModel extends ViewModel {
|
||||||
return this._timelineVM;
|
return this._timelineVM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isEncrypted() {
|
||||||
|
return this._room.isEncrypted;
|
||||||
|
}
|
||||||
|
|
||||||
get error() {
|
get error() {
|
||||||
if (this._timelineError) {
|
if (this._timelineError) {
|
||||||
return `Something went wrong loading the timeline: ${this._timelineError.message}`;
|
return `Something went wrong loading the timeline: ${this._timelineError.message}`;
|
||||||
|
@ -147,6 +151,10 @@ class ComposerViewModel extends ViewModel {
|
||||||
this._isEmpty = true;
|
this._isEmpty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isEncrypted() {
|
||||||
|
return this._roomVM.isEncrypted;
|
||||||
|
}
|
||||||
|
|
||||||
sendMessage(message) {
|
sendMessage(message) {
|
||||||
const success = this._roomVM._sendMessage(message);
|
const success = this._roomVM._sendMessage(message);
|
||||||
if (success) {
|
if (success) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ export class MessageComposer extends TemplateView {
|
||||||
|
|
||||||
render(t, vm) {
|
render(t, vm) {
|
||||||
this._input = t.input({
|
this._input = t.input({
|
||||||
placeholder: "Send a message ...",
|
placeholder: vm.isEncrypted ? "Send an encrypted message…" : "Send a message…",
|
||||||
onKeydown: e => this._onKeyDown(e),
|
onKeydown: e => this._onKeyDown(e),
|
||||||
onInput: () => vm.setInput(this._input.value),
|
onInput: () => vm.setInput(this._input.value),
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,7 @@ export class TimelineLoadingView extends TemplateView {
|
||||||
render(t, vm) {
|
render(t, vm) {
|
||||||
return t.div({className: "TimelineLoadingView"}, [
|
return t.div({className: "TimelineLoadingView"}, [
|
||||||
spinner(t),
|
spinner(t),
|
||||||
t.div(vm.i18n`Loading messages…`)
|
t.div(vm.isEncrypted ? vm.i18n`Loading encrypted messages…` : vm.i18n`Loading messages…`)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue