Skip to content

Commit

Permalink
Revert "Don't show empty chat"
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham authored Feb 21, 2023
1 parent d3c2f04 commit 5b28eef
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
14 changes: 0 additions & 14 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,6 @@ function isChatRoom(report) {
return isUserCreatedPolicyRoom(report) || isDefaultRoom(report);
}

/**
* Whether the provided report is a direct message
* @param {Object} report
* @returns {Boolean}
*/
function isDirectMessage(report) {
return _.isEmpty(getChatType(report));
}

/**
* Get the policy type from a given report
* @param {Object} report
Expand Down Expand Up @@ -1373,11 +1364,6 @@ function shouldReportBeInOptionList(report, reportIDFromRoute, isInGSDMode, curr
return false;
}

// Exclude direct message chats that don't have any chat history
if (isDirectMessage(report) && report.maxSequenceNumber === 1) {
return false;
}

return true;
}

Expand Down
23 changes: 0 additions & 23 deletions tests/unit/SidebarFilterTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,6 @@ describe('Sidebar', () => {
});
});

it('excludes a report with no message', () => {
LHNTestUtils.getDefaultRenderedSidebarLinks();

// Given a report with no message
const report = {
...LHNTestUtils.getFakeReport(),
maxSequenceNumber: 1,
};

return waitForPromisesToResolve()

// When Onyx is updated to contain that report
.then(() => Onyx.multiSet({
[`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`]: report,
}))

// Then no reports are rendered in the LHN
.then(() => {
const optionRows = screen.queryAllByAccessibilityHint('Navigates to a chat');
expect(optionRows).toHaveLength(0);
});
});

it('includes or excludes policy expense chats depending on the beta', () => {
LHNTestUtils.getDefaultRenderedSidebarLinks();

Expand Down

0 comments on commit 5b28eef

Please sign in to comment.