Skip to content

Commit

Permalink
console: Apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ryaplots committed Aug 11, 2023
1 parent 1684b12 commit 184d0b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pkg/webui/components/rights-group/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import Radio from '@ttn-lw/components/radio-button'
import Message from '@ttn-lw/lib/components/message'

import PropTypes from '@ttn-lw/lib/prop-types'
import useDerivedRightProps from '@ttn-lw/lib/hooks/use-derived-rights-props'

import useDerivedRightProps from './use-derived-rights-props'

import style from './rights-group.styl'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2019 The Things Network Foundation, The Things Industries B.V.
// Copyright © 2023 The Things Network Foundation, The Things Industries B.V.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions pkg/webui/console/lib/components/require.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import PropTypes from '../../../lib/prop-types'

const Require = ({ children, featureCheck, condition, otherwise }) => {
const rights = useSelector(state => featureCheck?.rightsSelector(state))
const newCondition = condition || (Boolean(featureCheck) && featureCheck.check(rights))
const combinedCondition = condition || (Boolean(featureCheck) && featureCheck.check(rights))

const alternativeRender = useCallback(() => {
if (typeof otherwise === 'object') {
Expand All @@ -45,7 +45,7 @@ const Require = ({ children, featureCheck, condition, otherwise }) => {
return null
}, [otherwise])

if (!newCondition) {
if (!combinedCondition) {
return alternativeRender()
}

Expand Down

0 comments on commit 184d0b5

Please sign in to comment.