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: ensure composer not full size when onyx state missing #31602

Merged
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
8 changes: 6 additions & 2 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ const defaultProps = {
* @returns {String}
*/
function getReportID(route) {
// // The reportID is used inside a collection key and should not be empty, as an empty reportID will result in the entire collection being returned.
return String(lodashGet(route, 'params.reportID', null));
// The report ID is used in an onyx key. If it's an empty string, onyx will return
// a collection instead of an individual report.
// We can't use the default value functionality of `lodash.get()` because it only
// provides a default value on `undefined`, and will return an empty string.
// Placing the default value outside of `lodash.get()` is intentional.
return String(lodashGet(route, 'params.reportID') || 0);
}

function ReportScreen({
Expand Down
Loading