1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 07:23:14 +08:00

fix osu!direct download reloading all panels

This fixes the recreation of all panels when a download completes.
Also fixes NullReference when you download without ever opening the details of one Set.
This commit is contained in:
Unknown 2017-11-25 14:45:57 +01:00
parent b3279082e2
commit f6a33b3ea2
2 changed files with 6 additions and 4 deletions

View File

@ -234,7 +234,7 @@ namespace osu.Game.Overlays.BeatmapSet
private void handleBeatmapAdd(BeatmapSetInfo beatmap)
{
if (beatmap.OnlineBeatmapSetID == BeatmapSet.OnlineBeatmapSetID)
if (beatmap.OnlineBeatmapSetID == BeatmapSet?.OnlineBeatmapSetID)
downloadButtonsContainer.FadeOut(transition_duration);
}

View File

@ -65,8 +65,6 @@ namespace osu.Game.Overlays
}
ResultAmounts = new ResultCounts(distinctCount(artists), distinctCount(songs), distinctCount(tags));
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
}
}
@ -282,7 +280,11 @@ namespace osu.Game.Overlays
var sets = response.Select(r => r.ToBeatmapSet(rulesets)).Where(b => !presentOnlineIds.Contains(b.OnlineBeatmapSetID)).ToList();
// may not need scheduling; loads async internally.
Schedule(() => BeatmapSets = sets);
Schedule(() =>
{
BeatmapSets = sets;
recreatePanels(Filter.DisplayStyleControl.DisplayStyle.Value);
});
});
};