Skip to content

Commit

Permalink
#938 直播将互动区自动清理触发时机添加新增欢迎消息时触发
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmoyue committed Dec 14, 2024
1 parent 570c4ef commit 7a20b61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void Danmu(LiveRoomViewModel viewModel, object message)
}
}

if (viewModel.Messages.Count >= viewModel.CleanCount) viewModel.Messages.RemoveAt(0);
viewModel.CheckClearMessages();
viewModel.Messages.Add(m);
AddNewDanmu?.Invoke(null, m);
}
Expand Down Expand Up @@ -137,6 +137,7 @@ private void InteractWord(LiveRoomViewModel viewModel, object message)
msg.ShowMedal = info.ShowMedal;
}

viewModel.CheckClearMessages();
viewModel.Messages.Add(msg);
}

Expand Down
5 changes: 5 additions & 0 deletions src/BiliLite.UWP/ViewModels/Live/LiveRoomViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,11 @@ public async Task<bool> JoinRedPocketLottery()

}

public void CheckClearMessages()
{
if (Messages.Count >= CleanCount) Messages.RemoveAt(0);
}

public void Dispose()
{
foreach (var item in LotteryDanmu)
Expand Down

0 comments on commit 7a20b61

Please sign in to comment.