Skip to content

Disable long press for empty expense reports #62095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/Search/SearchList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ function SearchList(
if (shouldPreventLongPressRow || !isSmallScreenWidth || item?.isDisabled || item?.isDisabledCheckbox || !isFocused) {
return;
}
// disable long press for empty expense reports
if ('transactions' in item && item.transactions.length === 0) {
return;
}
Comment on lines +180 to +182
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SzymczakJ instead of this , lets introduce transactions optional property in TransactionListItemType, is that not ideal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we never have the transactions prop in the TransactionListItemType object. That change would just mislead people into thinking that they can expect that prop in the TransactionListItemType.
What's more I would also need to add transactions to ReportActionListItemType and TaskListItemType to make typescript happy.
I think it's better to leave these types as they are.

if (selectionMode?.isEnabled) {
onCheckboxPress(item);
return;
Expand Down
Loading