Skip to content

Commit

Permalink
Fix page component
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Nov 10, 2024
1 parent 30e3742 commit 40208cd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import PropTypes from 'prop-types'
import get from 'lodash/get'
import { isNil } from 'lodash'
import { isNil, minBy } from 'lodash'

import Html from 'rdmo/core/assets/js/components/Html'

Expand All @@ -21,8 +21,8 @@ const Page = ({ config, templates, overview, page, sets, values, fetchPage,

// sanity check
if (isNil(currentSet)) {
currentSetIndex = 0
currentSet = sets.find((set) => (set.set_prefix == currentSetPrefix && set.set_index == 0))
currentSetIndex = minBy(sets, 'set_index').set_index
currentSet = sets.find((set) => (set.set_prefix == currentSetPrefix && set.set_index == currentSetIndex))
}

const isManager = (overview.is_superuser || overview.is_editor || overview.is_reviewer)
Expand Down

0 comments on commit 40208cd

Please sign in to comment.