Skip to content

Commit

Permalink
try fix a save issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Jan 20, 2025
1 parent 77c4d53 commit 33fac80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/BE/Controllers/Chats/Messages/MessagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ public async Task<ActionResult> EditMessageInPlace(string encryptedMessageId, [F
return Forbid();
}

message.MessageContents = await content.ToMessageContents(fup, cancellationToken);
message.MessageContents.Clear();
foreach (MessageContent c in await content.ToMessageContents(fup, cancellationToken))
{
message.MessageContents.Add(c);
}
message.Chat.UpdatedAt = DateTime.UtcNow;
message.Edited = true;
await db.SaveChangesAsync(cancellationToken);
Expand Down

0 comments on commit 33fac80

Please sign in to comment.