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 =>
|
builder.Services.AddHttpClient<PodcastService>(client =>
|
||||||
{
|
{
|
||||||
client.BaseAddress = new Uri(APIUrl);
|
client.BaseAddress = new Uri(APIUrl);
|
||||||
|
client.DefaultRequestHeaders.Add("api-version", "1.0");
|
||||||
});
|
});
|
||||||
|
|
||||||
#if WINDOWS
|
#if WINDOWS
|
||||||
|
|
|
@ -128,21 +128,27 @@
|
||||||
{
|
{
|
||||||
isRoomHost = true;
|
isRoomHost = true;
|
||||||
roomCode = room.Code;
|
roomCode = room.Code;
|
||||||
await OnJoinRoom.InvokeAsync(room.Code);
|
await InvokeAsync(async () =>
|
||||||
await OnRoomCreated.InvokeAsync();
|
{
|
||||||
|
await OnJoinRoom.InvokeAsync(room.Code);
|
||||||
|
await OnRoomCreated.InvokeAsync();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void OnRoomUpdated(Room room)
|
private async void OnRoomUpdated(Room room)
|
||||||
{
|
{
|
||||||
if (currentRoom == null && !isRoomHost)
|
await InvokeAsync(async () =>
|
||||||
{
|
{
|
||||||
await SetPlayerState(room);
|
if (currentRoom == null && !isRoomHost)
|
||||||
}
|
{
|
||||||
currentRoom = room;
|
await SetPlayerState(room);
|
||||||
await InvokeAsync(StateHasChanged);
|
}
|
||||||
|
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)
|
private async Task SetPlayerState(Room room)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue