Merge pull request #174 from microsoft/danroth27/dotnet-7
Fix Blazor dispatch in Listen Together modepull/178/head^2
commit
ea56325188
|
@ -24,6 +24,7 @@ public static class MauiProgram
|
|||
builder.Services.AddHttpClient<PodcastService>(client =>
|
||||
{
|
||||
client.BaseAddress = new Uri(APIUrl);
|
||||
client.DefaultRequestHeaders.Add("api-version", "1.0");
|
||||
});
|
||||
|
||||
#if WINDOWS
|
||||
|
|
|
@ -128,21 +128,27 @@
|
|||
{
|
||||
isRoomHost = true;
|
||||
roomCode = room.Code;
|
||||
await OnJoinRoom.InvokeAsync(room.Code);
|
||||
await OnRoomCreated.InvokeAsync();
|
||||
await InvokeAsync(async () =>
|
||||
{
|
||||
await OnJoinRoom.InvokeAsync(room.Code);
|
||||
await OnRoomCreated.InvokeAsync();
|
||||
});
|
||||
}
|
||||
|
||||
private async void OnRoomUpdated(Room room)
|
||||
{
|
||||
if (currentRoom == null && !isRoomHost)
|
||||
await InvokeAsync(async () =>
|
||||
{
|
||||
await SetPlayerState(room);
|
||||
}
|
||||
currentRoom = room;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
if (currentRoom == null && !isRoomHost)
|
||||
{
|
||||
await SetPlayerState(room);
|
||||
}
|
||||
currentRoom = room;
|
||||
StateHasChanged();
|
||||
});
|
||||
}
|
||||
|
||||
private async void OnPlayerStateUpdated(Room room) => await SetPlayerState(room);
|
||||
private async void OnPlayerStateUpdated(Room room) => await InvokeAsync(() => SetPlayerState(room));
|
||||
|
||||
private async Task SetPlayerState(Room room)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue