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; 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) {

View file

@ -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),
}); });

View file

@ -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…`)
]); ]);
} }
} }