From 66e6cbd3e6b2a72262ebde47e7a1f15663eb95b1 Mon Sep 17 00:00:00 2001 From: dangershony Date: Mon, 16 Oct 2023 13:57:53 +0100 Subject: [PATCH] fix release yml and add network to base component --- .github/workflows/pull-request.yml | 4 ++-- src/Angor/Client/Pages/Recover.razor | 14 -------------- src/Angor/Client/Shared/BaseComponent.cs | 9 ++++++++- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 58bd3602..c49714ed 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -18,8 +18,8 @@ jobs: env: PROJECT_NAME: 'Blockcore.AtomicSwaps' - SOLUTION_PATH: 'src/Blockcore.AtomicSwaps.sln' - PROJECT_PATH: 'src/Blockcore.AtomicSwaps.Server/Blockcore.AtomicSwaps.Server.csproj' + SOLUTION_PATH: 'src/Angor.sln' + PROJECT_PATH: 'src/Angor/Server/Angor.Server.csproj' BUILD_CONFIGURATION: 'Release' steps: diff --git a/src/Angor/Client/Pages/Recover.razor b/src/Angor/Client/Pages/Recover.razor index 56956f1c..b9a4f911 100644 --- a/src/Angor/Client/Pages/Recover.razor +++ b/src/Angor/Client/Pages/Recover.razor @@ -253,8 +253,6 @@ private async Task FindInvestments() { - var network = _NetworkConfiguration.GetNetwork(); - var trxs = await _IndexerService.GetInvestmentsAsync(project.ProjectIdentifier); var trx = trxs.First(f => f.TransactionId == recoverySigs.TransactionId); @@ -364,8 +362,6 @@ private async Task PrepareToRecoverCoins() { - var network = _NetworkConfiguration.GetNetwork(); - var operationResult = await notificationComponent.LongOperation(async () => { var feeEstimation = await _WalletOperations.GetFeeEstimationAsync(); @@ -418,8 +414,6 @@ { showRecoveryModal = false; - var network = _NetworkConfiguration.GetNetwork(); - storage.AddOrUpdateSignatures(recoverySigs); var response = await _WalletOperations.PublishTransactionAsync(network, recoveryTransaction); @@ -442,8 +436,6 @@ private async Task PrepareToReleaseCoins() { - var network = _NetworkConfiguration.GetNetwork(); - var operationResult = await notificationComponent.LongOperation(async () => { var feeEstimation = await _WalletOperations.GetFeeEstimationAsync(); @@ -484,8 +476,6 @@ { showRecoveryReleaseModal = false; - var network = _NetworkConfiguration.GetNetwork(); - storage.AddOrUpdateSignatures(recoverySigs); var response = await _WalletOperations.PublishTransactionAsync(network, releaseRecoveryTransaction); @@ -509,8 +499,6 @@ private async Task PrepareEndOfProjectCoins() { - var network = _NetworkConfiguration.GetNetwork(); - var operationResult = await notificationComponent.LongOperation(async () => { var feeEstimation = await _WalletOperations.GetFeeEstimationAsync(); @@ -547,8 +535,6 @@ { showEndOfProjectModal = false; - var network = _NetworkConfiguration.GetNetwork(); - storage.AddOrUpdateSignatures(recoverySigs); var response = await _WalletOperations.PublishTransactionAsync(network, endOfProjectTransaction); diff --git a/src/Angor/Client/Shared/BaseComponent.cs b/src/Angor/Client/Shared/BaseComponent.cs index 4bdaa0ad..5e374b05 100644 --- a/src/Angor/Client/Shared/BaseComponent.cs +++ b/src/Angor/Client/Shared/BaseComponent.cs @@ -1,20 +1,26 @@ using Angor.Client.Storage; +using Angor.Shared; +using Blockcore.Networks; using Microsoft.AspNetCore.Components; namespace Angor.Client.Shared { public class BaseComponent : ComponentBase { + [Inject] + protected INetworkConfiguration _networkConfiguration { get; set; } + [Inject] protected IWalletStorage _walletStorage { get; set; } [Inject] protected NavigationManager NavigationManager { get; set; } - public NotificationComponent notificationComponent; protected bool hasWallet { get; set; } + protected Network network { get; set; } + protected void SharedMethod() { // Shared logic here... @@ -23,6 +29,7 @@ protected void SharedMethod() protected override void OnInitialized() { hasWallet = _walletStorage.HasWallet(); + network = _networkConfiguration.GetNetwork(); } } }