Skip to content

Commit

Permalink
remove lurkerMode checks because PrivacyUtils.sensitiveValue() handle…
Browse files Browse the repository at this point in the history
…s it internally already
  • Loading branch information
myxmaster committed Jan 30, 2025
1 parent 7be75a0 commit 362cea9
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions views/Activity/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ interface ActivityListItemProps {
| 'warning'
| 'warningReserve';
order?: Order;
lurkerMode: boolean;
}

const ActivityListItem = React.memo(
Expand All @@ -90,8 +89,7 @@ const ActivityListItem = React.memo(
selectedPaymentForOrder,
onItemPress,
getRightTitleTheme,
order,
lurkerMode
order
}: ActivityListItemProps) => {
const note = item.getNote;
let displayName = item.model;
Expand All @@ -116,11 +114,9 @@ const ActivityListItem = React.memo(
{keysendMessageOrMemo ? ': ' : ''}
{keysendMessageOrMemo ? (
<Text style={{ fontStyle: 'italic' }}>
{lurkerMode
? PrivacyUtils.sensitiveValue(
keysendMessageOrMemo
)?.toString()
: keysendMessageOrMemo}
{PrivacyUtils.sensitiveValue(
keysendMessageOrMemo
)?.toString()}
</Text>
) : (
''
Expand All @@ -140,11 +136,9 @@ const ActivityListItem = React.memo(
{keysendMessageOrMemo ? ': ' : ''}
{keysendMessageOrMemo ? (
<Text style={{ fontStyle: 'italic' }}>
{lurkerMode
? PrivacyUtils.sensitiveValue(
keysendMessageOrMemo
)?.toString()
: keysendMessageOrMemo}
{PrivacyUtils.sensitiveValue(
keysendMessageOrMemo
)?.toString()}
</Text>
) : (
''
Expand Down Expand Up @@ -311,13 +305,13 @@ const ActivityListItem = React.memo(
}}
ellipsizeMode="tail"
>
{lurkerMode
? PrivacyUtils.sensitiveValue(
{note.length > 150
? `${PrivacyUtils.sensitiveValue(
note.substring(0, 150)
)?.toString()}...`
: PrivacyUtils.sensitiveValue(
note
)?.toString()
: note.length > 150
? `${note.substring(0, 150)}...`
: note}
)?.toString()}
</ListItem.Subtitle>
</View>
)}
Expand Down Expand Up @@ -459,7 +453,6 @@ export default class Activity extends React.PureComponent<
const { filteredActivity, getActivityAndFilter } = ActivityStore;
const { recordPayment } = PosStore;
const { settings } = SettingsStore;
const lurkerMode = settings.privacy.lurkerMode || false;
const { fiat } = settings;

const order = route.params?.order;
Expand Down Expand Up @@ -625,7 +618,6 @@ export default class Activity extends React.PureComponent<
onItemPress={this.handleItemPress}
getRightTitleTheme={this.getRightTitleTheme}
order={route.params?.order}
lurkerMode={lurkerMode}
/>
)}
keyExtractor={(item, index) => `${item.model}-${index}`}
Expand Down

0 comments on commit 362cea9

Please sign in to comment.