1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Fix the crash in the visual testcase

This commit is contained in:
miterosan 2018-07-09 22:09:27 +02:00
parent ec914a5095
commit 290b6e5f1d
5 changed files with 8 additions and 6 deletions

View File

@ -3,6 +3,7 @@
using System.ComponentModel;
using osu.Framework.Graphics.Containers;
using osu.Game.Online.Chat;
using osu.Game.Overlays;
namespace osu.Game.Tests.Visual

View File

@ -15,6 +15,7 @@ using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Game.Online.Chat;
using osu.Game.Overlays.Chat;
using osu.Game.Overlays.Chat.Tabs;
using osu.Game.Users;
using OpenTK.Graphics;

View File

@ -50,7 +50,7 @@ namespace osu.Game.Online.Chat
private IAPIProvider api;
private ScheduledDelegate fetchMessagesScheduleder;
private GetMessagesRequest fetchMsgReq;
private GetPrivateMessagesRequest fetchPrivateMsgReq;
private GetPrivateMessagesRequest fetchUserMsgReq;
private long? lastChannelMsgId;
private long? lastUserMsgId;
@ -170,16 +170,16 @@ namespace osu.Game.Online.Chat
);
if (fetchPrivateMsgReq == null)
if (fetchUserMsgReq == null)
fetchMessages(
() => new GetPrivateMessagesRequest(lastChannelMsgId),
() => new GetPrivateMessagesRequest(lastUserMsgId),
messages =>
{
if (messages == null)
return;
handleUserMessages(messages);
lastUserMsgId = messages.LastOrDefault()?.Id ?? lastUserMsgId;
fetchPrivateMsgReq = null;
lastUserMsgId = messages.Max(m => m.Id) ?? lastUserMsgId;
fetchUserMsgReq = null;
}
);
}

View File

@ -124,6 +124,7 @@ namespace osu.Game
var channelManager = new ChannelManager();
dependencies.Inject(channelManager);
dependencies.Cache(channelManager);
AddInternal(channelManager);
dependencies.Cache(RulesetStore = new RulesetStore(contextFactory));
dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage));

View File

@ -332,7 +332,6 @@ namespace osu.Game.Overlays
channelManager.CurrentChannel.ValueChanged += currentChatChanged;
channelManager.JoinedChannels.CollectionChanged += joinedChannelsChanged;
channelManager.AvailableChannels.CollectionChanged += (sender, args) => channelSelection.UpdateAvailableChannels(channelManager.AvailableChannels);
Add(channelManager);
}
private void postMessage(TextBox textbox, bool newText)