Reset storyReplyContext whenever a story expires
This commit is contained in:
parent
25bc16300c
commit
e80d9d1f30
2 changed files with 55 additions and 2 deletions
|
@ -342,7 +342,9 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
);
|
||||
}
|
||||
|
||||
async hydrateStoryContext(inMemoryMessage?: MessageModel): Promise<void> {
|
||||
async hydrateStoryContext(
|
||||
inMemoryMessage?: MessageModel | null
|
||||
): Promise<void> {
|
||||
const storyId = this.get('storyId');
|
||||
if (!storyId) {
|
||||
return;
|
||||
|
@ -352,7 +354,10 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
return;
|
||||
}
|
||||
|
||||
const message = inMemoryMessage || (await getMessageById(storyId));
|
||||
const message =
|
||||
inMemoryMessage === undefined
|
||||
? await getMessageById(storyId)
|
||||
: inMemoryMessage;
|
||||
|
||||
if (!message) {
|
||||
const conversation = this.getConversation();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue