Skip to content

Commit fab8fc1

Browse files
committed
fix(activity): #2216 update items dropped from mempool
1 parent b26f0c1 commit fab8fc1

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

src/screens/Activity/ActivityListShort.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Button from '../../components/buttons/Button';
1313
import { useAppSelector } from '../../hooks/redux';
1414
import type { RootNavigationProp } from '../../navigation/types';
1515
import { activityItemsSelector } from '../../store/reselect/activity';
16-
import { IActivityItem } from '../../store/types/activity';
16+
import { EActivityType, IActivityItem } from '../../store/types/activity';
1717
import { showBottomSheet } from '../../store/utils/ui';
1818
import { Caption13Up } from '../../styles/text';
1919
import { groupActivityItems } from '../../utils/activity';
@@ -27,8 +27,15 @@ const ActivityListShort = (): ReactElement => {
2727
const items = useAppSelector(activityItemsSelector);
2828

2929
const groupedItems = useMemo(() => {
30-
const activityItems = items.slice(0, MAX_ACTIVITY_ITEMS);
31-
return groupActivityItems(activityItems);
30+
const sliced = items.slice(0, MAX_ACTIVITY_ITEMS);
31+
return groupActivityItems(sliced);
32+
}, [items]);
33+
34+
const droppedItems = useMemo(() => {
35+
const dropped = items.filter((item) => {
36+
return item.activityType === EActivityType.onchain && !item.exists;
37+
});
38+
return dropped;
3239
}, [items]);
3340

3441
const renderItem = useCallback(
@@ -67,8 +74,15 @@ const ActivityListShort = (): ReactElement => {
6774

6875
return (
6976
<View style={styles.content}>
70-
<Caption13Up color="secondary" style={styles.title}>
77+
<Caption13Up style={styles.title} color="secondary">
7178
{t('activity')}
79+
80+
{droppedItems.length !== 0 && (
81+
<Caption13Up color="red">
82+
{' '}
83+
({droppedItems.length} {t('activity_removed')})
84+
</Caption13Up>
85+
)}
7286
</Caption13Up>
7387

7488
{groupedItems.length === 0 ? (

src/screens/Activity/ListItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ const OnchainListItem = ({
108108
const amount = isSend ? value + fee : value;
109109

110110
let description: string;
111-
if (feeRateDescription) {
111+
if (!exists) {
112+
description = t('activity_removed');
113+
} else if (feeRateDescription) {
112114
description = t('activity_confirms_in', { feeRateDescription });
113115
} else {
114116
description = t('activity_low_fee');

0 commit comments

Comments
 (0)