Skip to content

Commit

Permalink
Refactor(WEB::Drawer): Code refractor and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ktutak1337 committed May 4, 2024
1 parent ecb0d60 commit a8d5bf3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Client/StellarChat.Client.Web/Components/Drawer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<MudTextField Class="pl-4 pr-4 pb-4" @bind-Value="@SearchText" Label="Find a conversation" Variant="Variant.Outlined" Adornment="Adornment.End" AdornmentIcon="@Icons.Material.Filled.Search" />
<MudDivider />
<MudList Clickable="true">
@foreach (var chatSessions in ChatSessions)
@foreach (var chatSession in ChatSessions)
{
<ChatHistoryItem ChatSessionIteam="@chatSessions" />
<ChatHistoryItem ChatSessionItem="@chatSession" />
}
</MudList>
</div>
Expand All @@ -55,7 +55,10 @@

public List<ChatSessionResponse> ChatSessions { get; set; } = new();

protected override async Task OnInitializedAsync()
protected override async Task OnInitializedAsync()
=> await LoadChatSessions();

private async Task LoadChatSessions()
{
var response = await _chatService.BrowseChatSessions();
ChatSessions = response.Items.ToList();
Expand Down

0 comments on commit a8d5bf3

Please sign in to comment.