Bugfix: allow refreshed profile page to be deleted

This commit is contained in:
Carlos Zamora 2020-12-26 17:56:56 -06:00
parent 1cadbf4493
commit dd2f3e5b59

View file

@ -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;
}
}