1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-30 06:52:53 +08:00

Use async flow for storing key binding changes to realm

This commit is contained in:
Dean Herbert 2022-10-11 15:37:22 +09:00
parent 7342fb7f51
commit 6f6290a21a

View File

@ -387,14 +387,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
if (bindTarget != null) bindTarget.IsBinding = true; if (bindTarget != null) bindTarget.IsBinding = true;
} }
private void updateStoreFromButton(KeyButton button) private void updateStoreFromButton(KeyButton button) =>
{ realm.WriteAsync(r => r.Find<RealmKeyBinding>(button.KeyBinding.ID).KeyCombinationString = button.KeyBinding.KeyCombinationString);
realm.Run(r =>
{
var binding = r.Find<RealmKeyBinding>(((IHasGuidPrimaryKey)button.KeyBinding).ID);
r.Write(() => binding.KeyCombinationString = button.KeyBinding.KeyCombinationString);
});
}
private void updateIsDefaultValue() private void updateIsDefaultValue()
{ {