forked from mystiq/hydrogen-web
await sending a message before clearing composer (this was missing all along)
This commit is contained in:
parent
053c94b60e
commit
9f0c3b9cea
2 changed files with 4 additions and 4 deletions
|
@ -47,8 +47,8 @@ export class ComposerViewModel extends ViewModel {
|
||||||
return this._roomVM.isEncrypted;
|
return this._roomVM.isEncrypted;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendMessage(message) {
|
async sendMessage(message) {
|
||||||
const success = this._roomVM._sendMessage(message, this._replyVM);
|
const success = await this._roomVM._sendMessage(message, this._replyVM);
|
||||||
if (success) {
|
if (success) {
|
||||||
this._isEmpty = true;
|
this._isEmpty = true;
|
||||||
this.emitChange("canSend");
|
this.emitChange("canSend");
|
||||||
|
|
|
@ -69,9 +69,9 @@ export class MessageComposer extends TemplateView {
|
||||||
this.value.clearReplyingTo();
|
this.value.clearReplyingTo();
|
||||||
}
|
}
|
||||||
|
|
||||||
_trySend() {
|
async _trySend() {
|
||||||
this._input.focus();
|
this._input.focus();
|
||||||
if (this.value.sendMessage(this._input.value)) {
|
if (await this.value.sendMessage(this._input.value)) {
|
||||||
this._input.value = "";
|
this._input.value = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue