1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:52:57 +08:00

Fix hard crash due to out-of-order chat sequencing

This commit is contained in:
Dean Herbert 2018-12-03 18:13:10 +09:00
parent 1d2626c94a
commit 14d9f1d8bb
2 changed files with 6 additions and 7 deletions

View File

@ -48,10 +48,6 @@ namespace osu.Game.Overlays.Chat
},
}
};
Channel.NewMessagesArrived += newMessagesArrived;
Channel.MessageRemoved += messageRemoved;
Channel.PendingMessageResolved += pendingMessageResolved;
}
protected override void LoadComplete()
@ -59,6 +55,11 @@ namespace osu.Game.Overlays.Chat
base.LoadComplete();
newMessagesArrived(Channel.Messages);
Channel.NewMessagesArrived += newMessagesArrived;
Channel.MessageRemoved += messageRemoved;
Channel.PendingMessageResolved += pendingMessageResolved;
scrollToEnd();
}
@ -78,8 +79,6 @@ namespace osu.Game.Overlays.Chat
flow.AddRange(displayMessages.Select(m => new ChatLine(m)));
if (!IsLoaded) return;
if (scroll.IsScrolledToEnd(10) || !flow.Children.Any() || newMessages.Any(m => m is LocalMessage))
scrollToEnd();

View File

@ -18,7 +18,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.1.4" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="ppy.osu.Framework" Version="2018.1120.0" />
<PackageReference Include="ppy.osu.Framework" Version="2018.1203.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />