Skip to content

Commit 2a9de18

Browse files
authored
Only Show Missing Items Badge when needed (#101)
1 parent 54e8a8f commit 2a9de18

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

components/LogisticNavigation.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ export default function LogisticNavigation({
9797

9898
const intl = useIntl();
9999

100+
const missingItemCount = getNodes(event.stock).filter(
101+
(stockEntry) => stockEntry.missingCount > 0
102+
).length;
103+
100104
return (
101105
<NavigationContainer independent={true}>
102106
<AppDrawer.Navigator
@@ -227,9 +231,8 @@ export default function LogisticNavigation({
227231
color={focused ? colors.white : colors.primaryLight}
228232
/>
229233
),
230-
tabBarBadge: getNodes(event.stock).filter(
231-
(stockEntry) => stockEntry.missingCount > 0
232-
).length,
234+
tabBarBadge:
235+
missingItemCount === 0 ? undefined : missingItemCount,
233236
}}
234237
>
235238
{(props) => (

0 commit comments

Comments
 (0)