This commit is contained in:
mmrbnjd
2025-08-08 23:45:39 +03:30
parent aaf477e92e
commit c90e4550c4

View File

@@ -304,7 +304,7 @@
Inbox3Items = await chatService.MyChatsIsFinished();
//-------------hub
var token = await localStorageService.GetItem<string>("U/key");
var token = await localStorageService.GetItem<string>("C/key");
string AddressHub = _Http.BaseAddress.AbsoluteUri.Replace("api/", "");
hubConnection = new HubConnectionBuilder()
@@ -317,7 +317,7 @@
hubConnection.On<ChatItemResponseDto>("ReceiveNewChatItemFromUser", async (chatitem) =>
{
if (ChatCurrent.ID == chatitem.ChatItemID)
if (ChatCurrent!=null && ChatCurrent.ID == chatitem.ChatItemID)
{
ChatCurrent.Responses.Add(chatitem);
StateHasChanged();
@@ -325,6 +325,11 @@
// Scroll to target if exists, otherwise scroll to bottom
await JS.InvokeVoidAsync("scrollToTargetOrBottom");
}
else if (Inbox2Items.Any(a => a.ID == chatitem.ChatItemID))
{
Inbox2Items = await chatService.MyChatsIsInProgress();
StateHasChanged();
}
});
hubConnection.On<int>("CheckMarkAsRead", async (chatresponseid) =>