@@ -695,10 +695,15 @@ function getTotalDonatedFromBadgesResponse(response) {
695695 const totalDonated =
696696 response ?. badges ?. total_donated ??
697697 response ?. total_donated ??
698- response ?. badges ?. totalDonated ;
698+ response ?. badges ?. totalDonated ??
699+ response ?. totalDonated ;
699700
700701 const numericTotal = Number ( totalDonated ) ;
701- return Number . isFinite ( numericTotal ) ? numericTotal : null ;
702+ return ! isNaN ( numericTotal ) &&
703+ totalDonated !== null &&
704+ totalDonated !== undefined
705+ ? numericTotal
706+ : null ;
702707}
703708
704709function renderTopDonators ( container , donators , thumbMap , currentUserId ) {
@@ -2367,8 +2372,10 @@ export async function updateContent(buttonInfo, contentContainer) {
23672372 'AvatarHeadshot' ,
23682373 '60x60' ,
23692374 ) ;
2370- const userThumb = thumbs [ 0 ] ?. imageUrl ;
2371- if ( userThumb ) {
2375+ const thumbData = thumbs [ 0 ] ;
2376+ const userThumbUrl = thumbData ?. imageUrl ;
2377+
2378+ if ( userThumbUrl ) {
23722379 const tierContainer = contentContainer . querySelector (
23732380 `#donator-tier-${ userTier } -header` ,
23742381 ) ;
@@ -2379,7 +2386,7 @@ export async function updateContent(buttonInfo, contentContainer) {
23792386 'margin-left: auto; display: inline-flex; align-items: center; gap: 8px; background-color: var(--rovalra-container-background-color, rgba(0,0,0,0.1)); padding: 4px 10px 4px 4px; border-radius: 20px; border: 1px solid var(--rovalra-border-color); color: var(--rovalra-main-text-color); white-space: nowrap;' ;
23802387
23812388 const img = document . createElement ( 'img' ) ;
2382- img . src = userThumb ;
2389+ img . src = userThumbUrl ;
23832390 img . style . cssText =
23842391 'width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;' ;
23852392 tierBadge . appendChild ( img ) ;
0 commit comments