mirror of
https://github.com/status-im/nft-faucet.git
synced 2025-02-24 12:38:30 +00:00
Fix NRE at ProviderPage when Network is not selected
This commit is contained in:
parent
fe62c61e68
commit
accc85e256
@ -5,5 +5,12 @@
|
|||||||
<PageTitle>Provider</PageTitle>
|
<PageTitle>Provider</PageTitle>
|
||||||
<RadzenContent Container="main">
|
<RadzenContent Container="main">
|
||||||
<RadzenHeading Size="H1" Text="Select network provider" />
|
<RadzenHeading Size="H1" Text="Select network provider" />
|
||||||
|
@if (AppState.SelectedNetwork == null)
|
||||||
|
{
|
||||||
|
<RadzenHeading Size="H3" Text="Please choose network first!" />
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
<CardList Data="@Data" @bind-SelectedItems="@AppState.Storage.SelectedProviders" />
|
<CardList Data="@Data" @bind-SelectedItems="@AppState.Storage.SelectedProviders" />
|
||||||
|
}
|
||||||
</RadzenContent>
|
</RadzenContent>
|
||||||
|
@ -27,7 +27,7 @@ public partial class ProviderPage : BasicComponent
|
|||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
Providers = AppState.Storage.Providers.Where(x => x.IsNetworkSupported(AppState.SelectedNetwork)).ToArray();
|
Providers = AppState.Storage.Providers.Where(x => AppState.SelectedNetwork != null && x.IsNetworkSupported(AppState.SelectedNetwork)).ToArray();
|
||||||
RefreshData();
|
RefreshData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,5 +28,5 @@ public class EthereumKeygenProvider : IProvider
|
|||||||
};
|
};
|
||||||
|
|
||||||
public bool IsNetworkSupported(INetwork network)
|
public bool IsNetworkSupported(INetwork network)
|
||||||
=> network.Type == NetworkType.Ethereum;
|
=> network?.Type == NetworkType.Ethereum;
|
||||||
}
|
}
|
||||||
|
@ -25,5 +25,5 @@ public class SolanaKeygenProvider : IProvider
|
|||||||
};
|
};
|
||||||
|
|
||||||
public bool IsNetworkSupported(INetwork network)
|
public bool IsNetworkSupported(INetwork network)
|
||||||
=> network.Type == NetworkType.Solana;
|
=> network?.Type == NetworkType.Solana;
|
||||||
}
|
}
|
||||||
|
@ -25,5 +25,5 @@ public class MetamaskProvider : IProvider
|
|||||||
};
|
};
|
||||||
|
|
||||||
public bool IsNetworkSupported(INetwork network)
|
public bool IsNetworkSupported(INetwork network)
|
||||||
=> network.Type == NetworkType.Ethereum;
|
=> network?.Type == NetworkType.Ethereum;
|
||||||
}
|
}
|
||||||
|
@ -25,5 +25,5 @@ public class PhantomProvider : IProvider
|
|||||||
};
|
};
|
||||||
|
|
||||||
public bool IsNetworkSupported(INetwork network)
|
public bool IsNetworkSupported(INetwork network)
|
||||||
=> network.Type == NetworkType.Solana;
|
=> network?.Type == NetworkType.Solana;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user