Ensure ChannelManager has access to API from point of construction

Closes https://github.com/ppy/osu/issues/18451.
This commit is contained in:
Dean Herbert
2022-06-08 18:54:23 +09:00
parent 4df8219c8f
commit c661f2b059
8 changed files with 27 additions and 19 deletions

View File

@ -61,8 +61,7 @@ namespace osu.Game.Online.Chat
/// </summary>
public IBindableList<Channel> AvailableChannels => availableChannels;
[Resolved]
private IAPIProvider api { get; set; }
private readonly IAPIProvider api;
[Resolved]
private UserLookupCache users { get; set; }
@ -71,8 +70,9 @@ namespace osu.Game.Online.Chat
private readonly IBindable<bool> isIdle = new BindableBool();
public ChannelManager()
public ChannelManager(IAPIProvider api)
{
this.api = api;
CurrentChannel.ValueChanged += currentChannelChanged;
}