Move GeneratedKey to AppState

This commit is contained in:
Ivan Yaremenchuk 2022-08-26 22:16:49 -05:00
parent 7ea4dbf9ea
commit 2962ca6446
2 changed files with 4 additions and 5 deletions

View File

@ -4,4 +4,5 @@ public class StateStorage
{ {
public Guid[] SelectedNetworks { get; set; } public Guid[] SelectedNetworks { get; set; }
public Guid[] SelectedProviders { get; set; } public Guid[] SelectedProviders { get; set; }
public EthereumKey GeneratedKey { get; set; }
} }

View File

@ -26,13 +26,11 @@ public partial class ProviderPage : BasicComponent
[Inject] [Inject]
protected NotificationService NotificationService { get; set; } protected NotificationService NotificationService { get; set; }
protected EthereumKey GeneratedKey { get; set; }
protected CardListItem[] Providers { get; private set; } protected CardListItem[] Providers { get; private set; }
protected override void OnInitialized() protected override void OnInitialized()
{ {
GeneratedKey = EthereumKey.GenerateNew(); // AppState.Storage.GeneratedKey = EthereumKey.GenerateNew();
Providers = new[] Providers = new[]
{ {
new CardListItem new CardListItem
@ -43,8 +41,8 @@ public partial class ProviderPage : BasicComponent
IsDisabled = false, IsDisabled = false,
Properties = new[] Properties = new[]
{ {
new CardListItemProperty { Name = "Private key", Value = GeneratedKey.PrivateKey }, new CardListItemProperty { Name = "Private key", Value = AppState.Storage.GeneratedKey?.PrivateKey ?? "<null>" },
new CardListItemProperty { Name = "Address", Value = GeneratedKey.Address }, new CardListItemProperty { Name = "Address", Value = AppState.Storage.GeneratedKey?.Address ?? "<null>" },
}, },
Badges = Array.Empty<CardListItemBadge>(), Badges = Array.Empty<CardListItemBadge>(),
}, },