From 6fb1e7ccd293a7d5c438979f665f108e6550c3e0 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Fri, 9 Jul 2021 17:01:34 -0400 Subject: [PATCH] do not show option to transfer ownership to yourself --- .../studio/modals/transfer-ownership-selection.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/studio/modals/transfer-ownership-selection.jsx b/src/views/studio/modals/transfer-ownership-selection.jsx index 1059829f9..fe40f07e6 100644 --- a/src/views/studio/modals/transfer-ownership-selection.jsx +++ b/src/views/studio/modals/transfer-ownership-selection.jsx @@ -5,6 +5,7 @@ import {FormattedMessage} from 'react-intl'; import ModalInnerContent from '../../../components/modal/base/modal-inner-content.jsx'; +import {selectUserId} from '../../../redux/session'; import {managers} from '../lib/redux-modules'; import {loadManagers} from '../lib/studio-member-actions'; @@ -12,7 +13,8 @@ import './transfer-ownership-modal.scss'; const TransferOwnershipSelection = ({ handleClose, - items + items, + userId }) => { useEffect(() => { if (items.length === 0) onLoadMore(); @@ -27,7 +29,7 @@ const TransferOwnershipSelection = ({
{items.map(item => - {item.username} + userId !== item.id && {item.username} )} {/* {moreToLoad &&
@@ -74,11 +76,13 @@ TransferOwnershipSelection.propTypes = { }) })), moreToLoad: PropTypes.bool, - onLoadMore: PropTypes.func + onLoadMore: PropTypes.func, + userId: PropTypes.number }; export default connect( state => ({ + userId: selectUserId(state), ...managers.selector(state) }), {