Skip to content

Commit

Permalink
Fix message view render issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
HillPhelmuth committed Feb 11, 2024
1 parent 073597e commit d2ba2ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ChatComponents/MessageView.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public partial class MessageView : ComponentBase
[Parameter]
[EditorRequired]
public Message Message { get; set; } = default!;
private string _previousContent = "";

[Inject] private IJSRuntime JsRuntime { get; set; } = default!;

Expand All @@ -21,6 +22,11 @@ protected override bool ShouldRender()

protected override Task OnParametersSetAsync()
{
if (Message.Content != _previousContent)
{
_previousContent = Message.Content ?? "";
_shouldRender = true;
}
if (Message.IsActiveStreaming || string.IsNullOrEmpty(Message.Content))
{
_shouldRender = true;
Expand Down

0 comments on commit d2ba2ba

Please # to comment.