diff --git a/pkg/webui/components/rights-group/index.js b/pkg/webui/components/rights-group/index.js index d54d6eec84..3ac34a3fba 100644 --- a/pkg/webui/components/rights-group/index.js +++ b/pkg/webui/components/rights-group/index.js @@ -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' diff --git a/pkg/webui/lib/hooks/use-derived-rights-props.js b/pkg/webui/components/rights-group/use-derived-rights-props.js similarity index 97% rename from pkg/webui/lib/hooks/use-derived-rights-props.js rename to pkg/webui/components/rights-group/use-derived-rights-props.js index 382a7337a7..190e47cd05 100644 --- a/pkg/webui/lib/hooks/use-derived-rights-props.js +++ b/pkg/webui/components/rights-group/use-derived-rights-props.js @@ -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. diff --git a/pkg/webui/console/lib/components/require.js b/pkg/webui/console/lib/components/require.js index 9bf89149a6..6f36a62c18 100644 --- a/pkg/webui/console/lib/components/require.js +++ b/pkg/webui/console/lib/components/require.js @@ -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') { @@ -45,7 +45,7 @@ const Require = ({ children, featureCheck, condition, otherwise }) => { return null }, [otherwise]) - if (!newCondition) { + if (!combinedCondition) { return alternativeRender() }