1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:42:56 +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;
}
private void updateStoreFromButton(KeyButton button)
{
realm.Run(r =>
{
var binding = r.Find<RealmKeyBinding>(((IHasGuidPrimaryKey)button.KeyBinding).ID);
r.Write(() => binding.KeyCombinationString = button.KeyBinding.KeyCombinationString);
});
}
private void updateStoreFromButton(KeyButton button) =>
realm.WriteAsync(r => r.Find<RealmKeyBinding>(button.KeyBinding.ID).KeyCombinationString = button.KeyBinding.KeyCombinationString);
private void updateIsDefaultValue()
{