Notification for failed story sends

This commit is contained in:
Josh Perez 2023-02-07 14:33:04 -05:00 committed by GitHub
parent 4c2f169783
commit e11f961d7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 3 deletions

View file

@ -1467,6 +1467,26 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
})
)
);
this.notifyStorySendFailed();
}
public notifyStorySendFailed(): void {
if (!isStory(this.attributes)) {
return;
}
notificationService.add({
conversationId: this.get('conversationId'),
storyId: this.id,
messageId: this.id,
senderTitle:
this.getConversation()?.getTitle() ?? window.i18n('Stories__mine'),
message: this.hasSuccessfulDelivery()
? window.i18n('icu:Stories__failed-send--partial')
: window.i18n('icu:Stories__failed-send--full'),
isExpiringMessage: false,
});
}
removeOutgoingErrors(incomingIdentifier: string): CustomError {
@ -1619,6 +1639,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
updatedAt: Date.now(),
}
);
this.notifyStorySendFailed();
}
}