Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit a2ba9f1

Browse files
committed
fix: error in home screen
1 parent fdee33c commit a2ba9f1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/app/(gifts)/index.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ const HomeScreen = () => {
204204

205205
<ScrollView style={styles.scrollView}>
206206
{filteredGifts.map((gift) => {
207-
if (!gift || !gift.id) {
207+
if (!gift || !gift.id || typeof gift !== 'object') {
208208
console.error('Invalid gift data:', gift);
209209
return null;
210210
}
@@ -213,12 +213,12 @@ const HomeScreen = () => {
213213
<GiftCard
214214
key={gift.id}
215215
id={gift.id}
216-
image={gift.image}
217-
title={gift.title}
218-
description={gift.description}
219-
price={gift.price}
220-
recipient={gift.recipient}
221-
selectedDate={gift.selectedDate}
216+
image={gift.image || ''}
217+
title={gift.title || ''}
218+
description={gift.description || ''}
219+
price={gift.price || 0}
220+
recipient={gift.recipient || ''}
221+
selectedDate={gift.selectedDate || ''}
222222
/>
223223
);
224224
})}

0 commit comments

Comments
 (0)