show encrypted status of room

This commit is contained in:
Bruno Windels 2020-09-11 11:35:53 +02:00
parent 0e3084cce3
commit 843e3e6b1c
3 changed files with 10 additions and 2 deletions

View file

@ -90,6 +90,10 @@ export class RoomViewModel extends ViewModel {
return this._timelineVM;
}
get isEncrypted() {
return this._room.isEncrypted;
}
get error() {
if (this._timelineError) {
return `Something went wrong loading the timeline: ${this._timelineError.message}`;
@ -147,6 +151,10 @@ class ComposerViewModel extends ViewModel {
this._isEmpty = true;
}
get isEncrypted() {
return this._roomVM.isEncrypted;
}
sendMessage(message) {
const success = this._roomVM._sendMessage(message);
if (success) {

View file

@ -24,7 +24,7 @@ export class MessageComposer extends TemplateView {
render(t, vm) {
this._input = t.input({
placeholder: "Send a message ...",
placeholder: vm.isEncrypted ? "Send an encrypted message…" : "Send a message…",
onKeydown: e => this._onKeyDown(e),
onInput: () => vm.setInput(this._input.value),
});

View file

@ -21,7 +21,7 @@ export class TimelineLoadingView extends TemplateView {
render(t, vm) {
return t.div({className: "TimelineLoadingView"}, [
spinner(t),
t.div(vm.i18n`Loading messages…`)
t.div(vm.isEncrypted ? vm.i18n`Loading encrypted messages…` : vm.i18n`Loading messages…`)
]);
}
}