From ec5270cbf4c99716db0d6b40740c09b40f1cb546 Mon Sep 17 00:00:00 2001 From: Rob Relyea Date: Fri, 1 Mar 2024 08:37:35 -0800 Subject: [PATCH] update percentages and save after import --- Pages/Import.razor | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Pages/Import.razor b/Pages/Import.razor index 602f870..01da2a5 100644 --- a/Pages/Import.razor +++ b/Pages/Import.razor @@ -3,6 +3,7 @@ @page "/import-accounts-bh" @inject IAppData appData @inject NavigationManager Navigation +@inject IProfileUtility ProfileUtilities @inject IList Funds @inject HttpClient Http @using Models @@ -475,7 +476,7 @@ } } } - private void finishImport() + private async void finishImport() { if (appData?.ImportResult is not null && appData?.FamilyData is not null) { foreach (var updatedAccount in appData.ImportResult.UpdatedAccounts) @@ -494,6 +495,9 @@ appData.FamilyData.Accounts.Add(newAccount); } } + + await appData.FamilyData.UpdatePercentagesAsync(); + await ProfileUtilities.Save(appData.CurrentProfileName, appData.FamilyData); appData.ImportResult = null; Navigation.NavigateTo("/portfolio-tracker");