Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed Sep 13, 2023
1 parent d56c5ad commit 747ee6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pages/observations.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ObservationsPage extends React.Component {
getPageSize() {
const { observations } = this.props;

if (observations.data.length) {
if (observations.data && observations.data.length) {
// What if the page only have 5 results...
return observations.data.length > 50 ? 50 : observations.data.length;
}
Expand Down
4 changes: 4 additions & 0 deletions selectors/operators-detail/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export const getOperatorDocumentationDate = (state) =>
const getParsedDocumentation = createSelector(
[operatorDocumentation, getOperatorDocumentationFMU],
(documentation, fmu) => {
if (!documentation.data) return null;

return documentation.data
.filter((doc) => !doc['required-operator-document']['contract-signature'])
.filter((doc) => !fmu || (doc.fmu && doc.fmu.id === fmu.id))
Expand Down Expand Up @@ -112,6 +114,8 @@ const getContractSignatureDocumentation = createSelector(
const getHistoricFMUs = createSelector(
[operatorDocumentation],
(documentation) => {
if (!documentation.data) return [];

const FMUS = uniqBy(documentation.data
.filter(d => d.fmu)
.map(d => d.fmu), 'id');
Expand Down

0 comments on commit 747ee6a

Please sign in to comment.