mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Fix test failure due to missing DI cached IdleTracker
This commit is contained in:
parent
8d927920cb
commit
1262e76a58
@ -68,20 +68,21 @@ namespace osu.Game.Online.Chat
|
|||||||
|
|
||||||
public readonly BindableBool HighPollRate = new BindableBool();
|
public readonly BindableBool HighPollRate = new BindableBool();
|
||||||
|
|
||||||
private IBindable<bool> isIdle;
|
private readonly IBindable<bool> isIdle = new BindableBool();
|
||||||
|
|
||||||
public ChannelManager()
|
public ChannelManager()
|
||||||
{
|
{
|
||||||
CurrentChannel.ValueChanged += currentChannelChanged;
|
CurrentChannel.ValueChanged += currentChannelChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader(permitNulls: true)]
|
||||||
private void load(IdleTracker idleTracker)
|
private void load(IdleTracker idleTracker)
|
||||||
{
|
{
|
||||||
HighPollRate.BindValueChanged(updatePollRate);
|
HighPollRate.BindValueChanged(updatePollRate);
|
||||||
|
|
||||||
isIdle = idleTracker.IsIdle.GetBoundCopy();
|
|
||||||
isIdle.BindValueChanged(updatePollRate, true);
|
isIdle.BindValueChanged(updatePollRate, true);
|
||||||
|
|
||||||
|
if (idleTracker != null)
|
||||||
|
isIdle.BindTo(idleTracker.IsIdle);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePollRate(ValueChangedEvent<bool> valueChangedEvent)
|
private void updatePollRate(ValueChangedEvent<bool> valueChangedEvent)
|
||||||
|
Loading…
Reference in New Issue
Block a user