fix(mypage): populate unread_present_count from ViewerPresents
The home-screen crate button reads this count via MyPageTask (parsed into Data.MyPage.data.unread_mail_count) and MyPageItemHome.cs:148 routes it into SetUnreadGiftCount to render the "N" bubble on the gift button. It was hardcoded 0, so tutorial gifts (5 presents sitting in the viewer's inbox after signup) showed no badge until the crate was opened. Add IViewerRepository.CountUnclaimedPresentsAsync and call it from MyPageController.Index. Regression test seeds a viewer with tutorial presents and asserts unread_present_count > 0. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -100,7 +100,7 @@ public class MyPageController : SVSimController
|
||||
CanGiveDailyLoginBonus = _loginBonus.IsDue(viewer),
|
||||
UnreceivedMissionRewardCount = 0, // TODO(mypage-stub): viewer mission progress
|
||||
ReceiveFriendApplyCount = 0, // TODO(mypage-stub): viewer friend-request inbox
|
||||
UnreadPresentCount = 0, // TODO(mypage-stub): viewer presents/mail
|
||||
UnreadPresentCount = await _viewerRepository.CountUnclaimedPresentsAsync(viewer.Id, HttpContext.RequestAborted),
|
||||
FriendBattleInviteCount = 0, // TODO(mypage-stub): viewer room-invite count
|
||||
GuildNotification = await BuildGuildNotificationAsync(viewer.Id, HttpContext.RequestAborted),
|
||||
LastAnnounceId = 0, // TODO(mypage-stub): globals announcement metadata
|
||||
|
||||
Reference in New Issue
Block a user