Locally bind to LocalUser

This commit is contained in:
Craftplacer 2021-05-27 00:59:29 +02:00
parent 88bdd8a7b7
commit d47370bac9
No known key found for this signature in database
GPG Key ID: 0D94BDA3F64B90CE

View File

@ -35,7 +35,7 @@ namespace osu.Game.Online.Chat
private Bindable<bool> notifyOnMention;
private Bindable<bool> notifyOnPM;
private IBindable<User> localUser;
private IBindable<User> localUser = new Bindable<User>();
private readonly BindableList<Channel> joinedChannels = new BindableList<Channel>();
[BackgroundDependencyLoader]
@ -43,9 +43,9 @@ namespace osu.Game.Online.Chat
{
notifyOnMention = config.GetBindable<bool>(OsuSetting.ChatHighlightName);
notifyOnPM = config.GetBindable<bool>(OsuSetting.ChatMessageNotification);
localUser = api.LocalUser;
channelManager.JoinedChannels.BindTo(joinedChannels);
api.LocalUser.BindTo(localUser);
// Listen for new messages
joinedChannels.CollectionChanged += channelsChanged;