Skip to content

Commit

Permalink
#882 removing configure await to support server side
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfranblanco committed Oct 27, 2022
1 parent d6aa2a4 commit 90b8f05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ private async Task SelectedAccountChanged(string ethereumAddress)
{
if(string.IsNullOrEmpty(ethereumAddress))
{
await NotifyAuthenticationStateAsEthereumDisconnected().ConfigureAwait(false);
await NotifyAuthenticationStateAsEthereumDisconnected();
}
else
{
await NotifyAuthenticationStateAsEthereumConnected(ethereumAddress).ConfigureAwait(false);
await NotifyAuthenticationStateAsEthereumConnected(ethereumAddress);
}
}

public async override Task<AuthenticationState> GetAuthenticationStateAsync()
{
if (EthereumHostProvider != null && EthereumHostProvider.Available)
{
var currentAddress = await EthereumHostProvider.GetProviderSelectedAccountAsync().ConfigureAwait(false);
var currentAddress = await EthereumHostProvider.GetProviderSelectedAccountAsync();
if (currentAddress != null)
{
var claimsPrincipal = GetClaimsPrincipal(currentAddress);
Expand All @@ -77,8 +77,8 @@ public async override Task<AuthenticationState> GetAuthenticationStateAsync()

public async Task NotifyAuthenticationStateAsEthereumConnected()
{
var currentAddress = await EthereumHostProvider.GetProviderSelectedAccountAsync().ConfigureAwait(false);
await NotifyAuthenticationStateAsEthereumConnected(currentAddress).ConfigureAwait(false);
var currentAddress = await EthereumHostProvider.GetProviderSelectedAccountAsync();
await NotifyAuthenticationStateAsEthereumConnected(currentAddress);
}

public async Task NotifyAuthenticationStateAsEthereumConnected(string currentAddress)
Expand Down
6 changes: 3 additions & 3 deletions src/Nethereum.Metamask.Blazor/MetamaskBlazorInterop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ public async ValueTask<string> GetSelectedAddress()
[JSInvokable()]
public static async Task MetamaskAvailableChanged(bool available)
{
await MetamaskHostProvider.Current.ChangeMetamaskAvailableAsync(available).ConfigureAwait(false);
await MetamaskHostProvider.Current.ChangeMetamaskAvailableAsync(available);
}

[JSInvokable()]
public static async Task SelectedAccountChanged(string selectedAccount)
{
await MetamaskHostProvider.Current.ChangeSelectedAccountAsync(selectedAccount).ConfigureAwait(false);
await MetamaskHostProvider.Current.ChangeSelectedAccountAsync(selectedAccount);
}

[JSInvokable()]
public static async Task SelectedNetworkChanged(string chainId)
{

await MetamaskHostProvider.Current.ChangeSelectedNetworkAsync((long)new HexBigInteger(chainId).Value).ConfigureAwait(false);
await MetamaskHostProvider.Current.ChangeSelectedNetworkAsync((long)new HexBigInteger(chainId).Value);
}

private T ConvertResponse<T>(string jsonResponseMessage)
Expand Down

0 comments on commit 90b8f05

Please sign in to comment.