mirror of
https://github.com/status-im/nft-faucet.git
synced 2025-02-24 12:38:30 +00:00
43 lines
958 B
C#
43 lines
958 B
C#
using Microsoft.AspNetCore.Components;
|
|
using NftFaucetRadzen.Models;
|
|
using NftFaucetRadzen.Options;
|
|
using NftFaucetRadzen.Services;
|
|
using NftFaucetRadzen.Services.Abstractions;
|
|
|
|
namespace NftFaucetRadzen.Components;
|
|
|
|
public abstract class BasicComponent : ComponentBase
|
|
{
|
|
[Inject]
|
|
protected NavigationManager UriHelper { get; set; }
|
|
|
|
[Inject]
|
|
protected ScopedAppState AppState { get; set; }
|
|
|
|
[Inject]
|
|
protected RefreshMediator RefreshMediator { get; set; }
|
|
|
|
[Inject]
|
|
protected Settings Settings { get; set; }
|
|
|
|
[Inject]
|
|
protected IPluginLoader PluginLoader { get; set; }
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
RefreshMediator.StateChanged += async () => await InvokeAsync(StateHasChangedSafe);
|
|
}
|
|
|
|
protected void StateHasChangedSafe()
|
|
{
|
|
try
|
|
{
|
|
InvokeAsync(StateHasChanged);
|
|
}
|
|
catch (Exception)
|
|
{
|
|
// ignored
|
|
}
|
|
}
|
|
}
|