Refactor migration to read the same as previous one

This commit is contained in:
Dean Herbert 2023-08-16 16:21:42 +09:00
parent 68db112882
commit caf0fd0742
1 changed files with 3 additions and 3 deletions

View File

@ -1022,10 +1022,10 @@ void convertOnlineIDs<T>() where T : RealmObject
{
// Clear default bindings for the chat focus toggle,
// as they would conflict with the newly-added leaderboard toggle.
var newKeyBindings = migration.NewRealm.All<RealmKeyBinding>().ToList();
var toggleChatBind = newKeyBindings.FirstOrDefault(bind => bind.ActionInt == (int)GlobalAction.ToggleChatFocus);
var keyBindings = migration.NewRealm.All<RealmKeyBinding>();
if (toggleChatBind != default && toggleChatBind.KeyCombination.Keys.SequenceEqual(new[] { InputKey.Tab }))
var toggleChatBind = keyBindings.FirstOrDefault(bind => bind.ActionInt == (int)GlobalAction.ToggleChatFocus);
if (toggleChatBind != null && toggleChatBind.KeyCombination.Keys.SequenceEqual(new[] { InputKey.Tab }))
migration.NewRealm.Remove(toggleChatBind);
break;