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