Update existing subscriptions to new style

Fix missing detach calls in `MusicController`
This commit is contained in:
Dean Herbert
2022-01-21 19:39:49 +09:00
parent 45aea9add5
commit 1f157d729d
14 changed files with 98 additions and 84 deletions

View File

@ -79,17 +79,17 @@ namespace osu.Game.Screens.Spectate
playingUserStates.BindTo(spectatorClient.PlayingUserStates);
playingUserStates.BindCollectionChanged(onPlayingUserStatesChanged, true);
realmSubscription = realmContextFactory.Context
.All<BeatmapSetInfo>()
.Where(s => !s.DeletePending)
.QueryAsyncWithNotifications((items, changes, ___) =>
{
if (changes?.InsertedIndices == null)
return;
realmSubscription = realmContextFactory.Register(realm =>
realm.All<BeatmapSetInfo>()
.Where(s => !s.DeletePending)
.QueryAsyncWithNotifications((items, changes, ___) =>
{
if (changes?.InsertedIndices == null)
return;
foreach (int c in changes.InsertedIndices)
beatmapUpdated(items[c]);
});
foreach (int c in changes.InsertedIndices)
beatmapUpdated(items[c]);
}));
foreach ((int id, var _) in userMap)
spectatorClient.WatchUser(id);