From 28a3db28b78f4669c9aaa47dcdbdb8981d448ebd Mon Sep 17 00:00:00 2001 From: zeppi Date: Thu, 3 Jun 2021 11:55:16 -0400 Subject: [PATCH] use tag to disable interactions on livestreams --- ui/component/fileActions/index.js | 3 +++ ui/component/fileActions/view.jsx | 4 +++- ui/component/livestreamLayout/index.js | 4 +++- ui/component/livestreamLayout/view.jsx | 11 ++++++++++- ui/component/page/view.jsx | 4 +++- ui/page/livestream/index.js | 4 +++- ui/page/livestream/view.jsx | 11 +++++++++-- 7 files changed, 34 insertions(+), 7 deletions(-) diff --git a/ui/component/fileActions/index.js b/ui/component/fileActions/index.js index c41e55c52..0e15bb7ea 100644 --- a/ui/component/fileActions/index.js +++ b/ui/component/fileActions/index.js @@ -6,7 +6,9 @@ import { doPrepareEdit, selectMyChannelClaims, makeSelectClaimIsStreamPlaceholder, + makeSelectTagInClaimOrChannelForUri, } from 'lbry-redux'; +import { DISABLE_COMMENTS_TAG } from 'constants/tags'; import { makeSelectCostInfoForUri } from 'lbryinc'; import { doSetPlayingUri } from 'redux/actions/content'; import { doToast } from 'redux/actions/notifications'; @@ -23,6 +25,7 @@ const select = (state, props) => ({ costInfo: makeSelectCostInfoForUri(props.uri)(state), myChannels: selectMyChannelClaims(state), isLivestreamClaim: makeSelectClaimIsStreamPlaceholder(props.uri)(state), + reactionsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state), }); const perform = (dispatch) => ({ diff --git a/ui/component/fileActions/view.jsx b/ui/component/fileActions/view.jsx index c12a7206b..c99ed19cd 100644 --- a/ui/component/fileActions/view.jsx +++ b/ui/component/fileActions/view.jsx @@ -26,6 +26,7 @@ type Props = { doToast: ({ message: string }) => void, clearPlayingUri: () => void, isLivestreamClaim: boolean, + reactionsDisabled: boolean, }; function FileActions(props: Props) { @@ -42,6 +43,7 @@ function FileActions(props: Props) { clearPlayingUri, doToast, isLivestreamClaim, + reactionsDisabled, } = props; const { push, @@ -82,7 +84,7 @@ function FileActions(props: Props) { const lhsSection = ( <> - {ENABLE_FILE_REACTIONS && } + {ENABLE_FILE_REACTIONS && !reactionsDisabled && }