Skip to content

Commit

Permalink
Bugfix: allow refreshed profile page to be deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-zamora committed Dec 26, 2020
1 parent 1cadbf4 commit dd2f3e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cascadia/TerminalSettingsEditor/MainPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
{
if (const auto tag{ selectedItem.as<MUX::Controls::NavigationViewItem>().Tag() })
{
if (const auto profile{ tag.try_as<Model::Profile>() })
if (const auto oldProfile{ tag.try_as<Model::Profile>() })
{
// check if the profile still exists
if (_settingsClone.FindProfile(profile.Guid()))
if (const auto profile{ _settingsClone.FindProfile(oldProfile.Guid()) })
{
// Navigate to the page with the given profile
contentFrame().Navigate(xaml_typename<Editor::Profiles>(), winrt::make<ProfilePageNavigationState>(_viewModelForProfile(profile), _settingsClone.GlobalSettings().ColorSchemes(), *this));
_Navigate(_viewModelForProfile(profile));
return;
}
}
Expand Down

0 comments on commit dd2f3e5

Please sign in to comment.