Skip to content

Commit

Permalink
Merge pull request #31602 from erquhart/fix/31089-composer-large-on-f…
Browse files Browse the repository at this point in the history
…irst-render

fix: ensure composer not full size when onyx state missing
  • Loading branch information
tgolen authored Nov 21, 2023
2 parents ae0a68e + ef75931 commit 7f73a1f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,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

0 comments on commit 7f73a1f

Please sign in to comment.