fix: TypeError: undefined is not a function
This commit is contained in:
parent
13c1bd8f01
commit
4a1ac73420
1 changed files with 7 additions and 3 deletions
|
|
@ -130,8 +130,13 @@ export default function Header() {
|
|||
animated = hasAnimatedAvatar;
|
||||
}
|
||||
// Fall back to default avatar
|
||||
else if (getDefaultAvatarURL) {
|
||||
else if (getDefaultAvatarURL && typeof getDefaultAvatarURL === 'function') {
|
||||
try {
|
||||
url = getDefaultAvatarURL(currentUser);
|
||||
} catch (error) {
|
||||
console.error('Error getting default avatar URL:', error);
|
||||
url = null;
|
||||
}
|
||||
}
|
||||
// Last resort: Construct Discord CDN URL
|
||||
else if (currentUser.avatar) {
|
||||
|
|
@ -219,7 +224,6 @@ export default function Header() {
|
|||
/>
|
||||
{isAnimatedAvatar && (
|
||||
<RN.View style={styles.animatedIndicator}>
|
||||
<RN.Text style={styles.gifText}>GIF</RN.Text>
|
||||
</RN.View>
|
||||
)}
|
||||
</>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue