1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 21:53:22 +08:00

Fix binding order

This commit is contained in:
Craftplacer 2021-06-05 11:03:49 +02:00
parent b3ac67675e
commit b746fe7c03
No known key found for this signature in database
GPG Key ID: 0D94BDA3F64B90CE

View File

@ -36,19 +36,18 @@ namespace osu.Game.Online.Chat
private Bindable<bool> notifyOnMention; private Bindable<bool> notifyOnMention;
private Bindable<bool> notifyOnPM; private Bindable<bool> notifyOnPM;
private readonly IBindable<User> localUser = new Bindable<User>(); private readonly IBindable<User> localUser = new Bindable<User>();
private readonly BindableList<Channel> joinedChannels = new BindableList<Channel>(); private readonly IBindableList<Channel> joinedChannels = new BindableList<Channel>();
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config, IAPIProvider api) private void load(OsuConfigManager config, IAPIProvider api)
{ {
notifyOnMention = config.GetBindable<bool>(OsuSetting.ChatHighlightName); notifyOnMention = config.GetBindable<bool>(OsuSetting.ChatHighlightName);
notifyOnPM = config.GetBindable<bool>(OsuSetting.ChatMessageNotification); notifyOnPM = config.GetBindable<bool>(OsuSetting.ChatMessageNotification);
api.LocalUser.BindTo(localUser); localUser.BindTo(api.LocalUser);
// Listen for new messages // Listen for new messages
joinedChannels.CollectionChanged += channelsChanged; joinedChannels.CollectionChanged += channelsChanged;
joinedChannels.BindTo(channelManager.JoinedChannels);
channelManager.JoinedChannels.BindTo(joinedChannels);
} }
private void channelsChanged(object sender, NotifyCollectionChangedEventArgs e) private void channelsChanged(object sender, NotifyCollectionChangedEventArgs e)