fix: deactivating an inactive menu item doesn't work as expected (#1102)

This commit is contained in:
bd_ 2024-09-04 12:41:00 -07:00 committed by GitHub
parent 389ae4f2cc
commit 89b4c8f921
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,7 +133,7 @@ namespace nadena.dev.modular_avatar.core.editor.Simulator
}
else
{
if (MenuItemOverrides.Value.TryGetValue(prop, out var existing) && ReferenceEquals(existing, item))
if (!MenuItemOverrides.Value.TryGetValue(prop, out var existing) || ReferenceEquals(existing, item))
MenuItemOverrides.Value = MenuItemOverrides.Value.SetItem(prop, null);
}