try fix dailynote notification user sync

This commit is contained in:
Lightczx
2023-08-25 11:36:07 +08:00
parent b7642847cd
commit c1cc4961a0

View File

@@ -46,14 +46,21 @@ internal sealed partial class DailyNoteNotificationOperation
string? attribution = SH.ServiceDailyNoteNotifierAttribution;
Response<ListWrapper<UserGameRole>> rolesResponse = await bindingClient
.GetUserGameRolesOverseaAwareAsync(entry.User)
.ConfigureAwait(false);
if (rolesResponse.IsOk())
if (entry.UserGameRole is not null)
{
List<UserGameRole> roles = rolesResponse.Data.List;
attribution = roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? ToastAttributionUnknown;
attribution = entry.UserGameRole.ToString();
}
else
{
Response<ListWrapper<UserGameRole>> rolesResponse = await bindingClient
.GetUserGameRolesOverseaAwareAsync(entry.User)
.ConfigureAwait(false);
if (rolesResponse.IsOk())
{
List<UserGameRole> roles = rolesResponse.Data.List;
attribution = roles.SingleOrDefault(r => r.GameUid == entry.Uid)?.ToString() ?? ToastAttributionUnknown;
}
}
ToastContentBuilder builder = new ToastContentBuilder()