Skip to content
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

Fix: Request money - Five most recent chats aren't shown correctly #8549

Merged
merged 16 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
7 changes: 6 additions & 1 deletion src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,13 +637,15 @@ function getOptions(reports, personalDetails, activeReportID, {
* @param {Object} personalDetails
* @param {String} searchValue
* @param {Array<String>} betas
* @param {Boolean} sortByLastMessageTimestamp
* @returns {Object}
*/
function getSearchOptions(
reports,
personalDetails,
searchValue = '',
betas,
sortByLastMessageTimestamp,
) {
return getOptions(reports, personalDetails, 0, {
betas,
Expand All @@ -657,7 +659,7 @@ function getSearchOptions(
showChatPreviewLine: true,
showReportsWithNoComments: true,
includePersonalDetails: true,
sortByLastMessageTimestamp: false,
sortByLastMessageTimestamp,
forcePolicyNamePreview: true,
prioritizeIOUDebts: false,
});
Expand Down Expand Up @@ -704,6 +706,7 @@ function getIOUConfirmationOptionsFromParticipants(
* @param {String} searchValue
* @param {Array} selectedOptions
* @param {Array} excludeLogins
* @param {Boolean} sortByLastMessageTimestamp
* @returns {Object}
*/
function getNewChatOptions(
Expand All @@ -713,6 +716,7 @@ function getNewChatOptions(
searchValue = '',
selectedOptions = [],
excludeLogins = [],
sortByLastMessageTimestamp,
) {
return getOptions(reports, personalDetails, 0, {
betas,
Expand All @@ -723,6 +727,7 @@ function getNewChatOptions(
includePersonalDetails: true,
maxRecentReportsToShow: 5,
excludeLogins,
sortByLastMessageTimestamp,
});
}

Expand Down
3 changes: 3 additions & 0 deletions src/pages/NewChatPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class NewChatPage extends Component {
'',
[],
this.props.isGroupChat ? this.excludedGroupEmails : [],
true,
);
this.state = {
searchValue: '',
Expand Down Expand Up @@ -184,6 +185,7 @@ class NewChatPage extends Component {
prevState.searchValue,
[],
this.excludedGroupEmails,
true,
);

return {
Expand Down Expand Up @@ -256,6 +258,7 @@ class NewChatPage extends Component {
searchValue,
[],
this.props.isGroupChat ? this.excludedGroupEmails : [],
true,
);
this.setState({
searchValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class IOUParticipantsRequest extends Component {
'',
[],
CONST.EXPENSIFY_EMAILS,
true,
);

this.state = {
Expand Down Expand Up @@ -127,6 +128,7 @@ class IOUParticipantsRequest extends Component {
searchValue,
[],
CONST.EXPENSIFY_EMAILS,
true,
);
this.setState({
searchValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class IOUParticipantsSplit extends Component {
'',
props.participants,
CONST.EXPENSIFY_EMAILS,
true,
);

this.state = {
Expand Down Expand Up @@ -175,6 +176,7 @@ class IOUParticipantsSplit extends Component {
isOptionInList ? prevState.searchValue : '',
newSelectedOptions,
CONST.EXPENSIFY_EMAILS,
true,
);
return {
recentReports,
Expand Down Expand Up @@ -217,6 +219,7 @@ class IOUParticipantsSplit extends Component {
searchValue,
[],
CONST.EXPENSIFY_EMAILS,
true,
);
this.setState({
searchValue,
Expand Down
Loading