Fix overly-verbose errors in message details

This commit is contained in:
Fedor Indutny 2021-07-27 16:11:38 -07:00 committed by GitHub
parent 114a9b6969
commit 4c933a1f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,8 @@
.module-message-detail__label {
@include font-body-1-bold;
min-width: 72px;
}
.module-message-detail__unix-timestamp {

View File

@ -1610,7 +1610,9 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
const promises: Array<Promise<unknown>> = [];
let errors: Array<CustomError>;
if (isCustomError(result.value)) {
if (result.value instanceof SendMessageProtoError && result.value.errors) {
({ errors } = result.value);
} else if (isCustomError(result.value)) {
errors = [result.value];
} else if (Array.isArray(result.value.errors)) {
({ errors } = result.value);