Skip to content

Commit

Permalink
update percentages and save after import
Browse files Browse the repository at this point in the history
  • Loading branch information
rrelyea committed Mar 1, 2024
1 parent 6857b7f commit ec5270c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Pages/Import.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@page "/import-accounts-bh"
@inject IAppData appData
@inject NavigationManager Navigation
@inject IProfileUtility ProfileUtilities
@inject IList<Fund> Funds
@inject HttpClient Http
@using Models
Expand Down Expand Up @@ -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)
Expand All @@ -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");
Expand Down

0 comments on commit ec5270c

Please sign in to comment.