mirror of
https://github.com/osukey/osukey.git
synced 2025-05-15 02:27:33 +09:00
Fix delete local scores crashing the game
This commit is contained in:
parent
2453bf5ed0
commit
0d3ac4fd9c
@ -266,6 +266,15 @@ namespace osu.Game.Scoring
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Delete(BeatmapInfo beatmap, bool silent = false)
|
||||||
|
{
|
||||||
|
realm.Run(r =>
|
||||||
|
{
|
||||||
|
var beatmapScores = r.Find<BeatmapInfo>(beatmap.ID).Scores.ToList();
|
||||||
|
scoreModelManager.Delete(beatmapScores, silent);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void Delete(List<ScoreInfo> items, bool silent = false)
|
public void Delete(List<ScoreInfo> items, bool silent = false)
|
||||||
{
|
{
|
||||||
scoreModelManager.Delete(items, silent);
|
scoreModelManager.Delete(items, silent);
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Text = @"Yes. Please.",
|
Text = @"Yes. Please.",
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
Task.Run(() => scoreManager.Delete(s => !s.DeletePending && s.BeatmapInfo.ID == beatmapInfo.ID))
|
Task.Run(() => scoreManager.Delete(beatmapInfo))
|
||||||
.ContinueWith(_ => onCompletion);
|
.ContinueWith(_ => onCompletion);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user