Skip to content

Commit

Permalink
FIX Allow no recordId to be passed in to avoid console error in dev (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz authored Jun 18, 2024
1 parent d1fd54e commit 0c02307
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions client/src/components/HistoryViewer/HistoryViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,11 @@ class HistoryViewer extends Component {
}

render() {
const { loading, compare, currentVersion } = this.props;
const { loading, compare, currentVersion, recordId } = this.props;

if (!recordId) {
return null;
}

if (loading) {
return <Loading />;
Expand All @@ -391,7 +395,7 @@ HistoryViewer.propTypes = {
limit: PropTypes.number,
ListComponent: PropTypes.elementType.isRequired,
offset: PropTypes.number,
recordId: PropTypes.number.isRequired,
recordId: PropTypes.number,
currentVersion: PropTypes.oneOfType([PropTypes.bool, versionType]),
compare: compareType,
isInGridField: PropTypes.bool,
Expand Down

0 comments on commit 0c02307

Please sign in to comment.