Improve error code

This commit is contained in:
RMidhunSuresh 2021-12-14 14:42:09 +05:30
parent 67da746b48
commit 4a12acf157
2 changed files with 5 additions and 5 deletions

View File

@ -90,10 +90,10 @@ class ReplyPreviewTile extends TextTile {
} }
get decryptionError() { get decryptionError() {
return !!this._entry.decryptionError; return this._entry.decryptionError;
} }
get error() { get hasError() {
return this.isRedacted || this.decryptionError; return this.isRedacted || !!this.decryptionError;
} }
} }

View File

@ -26,7 +26,7 @@ export class ReplyPreviewView extends TemplateView {
while (replyContainer.lastChild) { while (replyContainer.lastChild) {
replyContainer.removeChild(replyContainer.lastChild); replyContainer.removeChild(replyContainer.lastChild);
} }
replyContainer.appendChild(vm.error? this._renderError(vm) : this._renderReplyPreview(vm)); replyContainer.appendChild(vm.hasError? this._renderError(vm) : this._renderReplyPreview(vm));
}) })
return replyContainer; return replyContainer;
} }
@ -49,7 +49,7 @@ export class ReplyPreviewView extends TemplateView {
return "This message has been deleted."; return "This message has been deleted.";
} }
else if (vm.decryptionError) { else if (vm.decryptionError) {
return "This message could not be decrypted." return vm.decryptionError.message;
} }
} }