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 report icon logic for newly created policy rooms #7252

Merged
merged 6 commits into from
Jan 25, 2022
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
6 changes: 6 additions & 0 deletions src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import * as API from '../API';
import CONST from '../../CONST';
import Log from '../Log';
import * as ReportUtils from '../reportUtils';
import * as OptionsListUtils from '../OptionsListUtils';
import Timers from '../Timers';
import * as ReportActions from './ReportActions';
import Growl from '../Growl';
Expand Down Expand Up @@ -1538,6 +1539,11 @@ function createPolicyRoom(policyID, reportName, visibility) {
Log.error('Unable to grab policy room after creation', reportID);
return;
}

// Make sure the report has its icons set
const report = allReports[reportID];
const icons = OptionsListUtils.getReportIcons(report, {});
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {icons});
Navigation.navigate(ROUTES.getReportRoute(reportID));
})
.catch(() => {
Expand Down