From 9e1806501b388e18bd08b45e9da715c25119a3c0 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Sun, 2 Aug 2026 20:36:49 +0530 Subject: [PATCH 1/2] fix: code quality and safety improvements --- apps/mobile/src/components/Avatar.tsx | 2 +- apps/mobile/src/screens/DevCardViewScreen.tsx | 2 +- apps/web/src/pages/CardPage.tsx | 4 ++-- apps/web/src/pages/ProfilePage.tsx | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/mobile/src/components/Avatar.tsx b/apps/mobile/src/components/Avatar.tsx index 8a0ee0c8..b5d1fb0e 100644 --- a/apps/mobile/src/components/Avatar.tsx +++ b/apps/mobile/src/components/Avatar.tsx @@ -10,7 +10,7 @@ type Props = { }; export const Avatar: React.FC = ({ uri, name = 'D', size = 56, style }) => { - const initials = name.charAt(0).toUpperCase(); + const initials = name[0].toUpperCase(); const imageStyle = [{ width: size, height: size, borderRadius: size / 2 } as ImageStyle, style as ImageStyle]; const placeholderStyle = [{ width: size, height: size, borderRadius: size / 2, backgroundColor: COLORS.primary }, style as ViewStyle]; diff --git a/apps/mobile/src/screens/DevCardViewScreen.tsx b/apps/mobile/src/screens/DevCardViewScreen.tsx index 3698c862..56bb2702 100644 --- a/apps/mobile/src/screens/DevCardViewScreen.tsx +++ b/apps/mobile/src/screens/DevCardViewScreen.tsx @@ -453,7 +453,7 @@ export default function DevCardViewScreen({ navigation, route }: Props) { ) : ( - {PLATFORM_EMOJI[link.platform] || platform?.name.charAt(0) || '?'} + {PLATFORM_EMOJI[link.platform] || platform?.name[0] || '?'} )} diff --git a/apps/web/src/pages/CardPage.tsx b/apps/web/src/pages/CardPage.tsx index 690ce574..d54c7b6a 100644 --- a/apps/web/src/pages/CardPage.tsx +++ b/apps/web/src/pages/CardPage.tsx @@ -104,7 +104,7 @@ export default function CardPage() { className="card-avatar-placeholder" style={{ background: card.owner.accentColor || '#6366F1' }} > - {card.owner.displayName.charAt(0).toUpperCase()} + {card.owner.displayName[0].toUpperCase()} )} @@ -143,7 +143,7 @@ export default function CardPage() { id={`platform-tile-${link.platform}`} >
- {link.platform.charAt(0).toUpperCase()} + {link.platform[0].toUpperCase()}
{link.platform} diff --git a/apps/web/src/pages/ProfilePage.tsx b/apps/web/src/pages/ProfilePage.tsx index 94a84f54..abc4286a 100644 --- a/apps/web/src/pages/ProfilePage.tsx +++ b/apps/web/src/pages/ProfilePage.tsx @@ -126,7 +126,7 @@ export default function ProfilePage() { className="avatar avatar-placeholder" style={{ background: profile.accentColor }} > - {profile.displayName.charAt(0).toUpperCase()} + {profile.displayName[0].toUpperCase()}
)}
@@ -157,7 +157,7 @@ export default function ProfilePage() { >
- {platform?.name.charAt(0) || '?'} + {platform?.name[0] || '?'}
From a7306a67f2cdf81d71e1f59137a7f1c3d055029b Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Mon, 3 Aug 2026 00:14:51 +0530 Subject: [PATCH 2/2] fix: additional real bug fixes --- apps/mobile/src/screens/DevCardViewScreen.tsx | 2 +- apps/web/src/pages/CardPage.tsx | 2 +- apps/web/src/pages/ProfilePage.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/mobile/src/screens/DevCardViewScreen.tsx b/apps/mobile/src/screens/DevCardViewScreen.tsx index 56bb2702..99a28b77 100644 --- a/apps/mobile/src/screens/DevCardViewScreen.tsx +++ b/apps/mobile/src/screens/DevCardViewScreen.tsx @@ -415,7 +415,7 @@ export default function DevCardViewScreen({ navigation, route }: Props) { description="This DevCard profile does not have any platform links available." /> - ) : profile.links.map(link => { + ) : profile.(links ?? []).map(link => { const platform = PLATFORMS[link.platform]; const state = followStates[link.id] || 'idle'; const btnColor = getButtonColor(link, state); diff --git a/apps/web/src/pages/CardPage.tsx b/apps/web/src/pages/CardPage.tsx index d54c7b6a..1b6ddf82 100644 --- a/apps/web/src/pages/CardPage.tsx +++ b/apps/web/src/pages/CardPage.tsx @@ -134,7 +134,7 @@ export default function CardPage() {

Connections

- {card.links.map((link) => ( + {card.(links ?? []).map((link) => (