From fab69450c0d828f9d9560280aba63f3850c8b02c Mon Sep 17 00:00:00 2001 From: Franco Montenegro Date: Wed, 8 Jun 2022 18:11:05 -0300 Subject: [PATCH] Hide watched progress if claim is being played. (#7606) --- ui/component/fileThumbnail/index.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/component/fileThumbnail/index.js b/ui/component/fileThumbnail/index.js index f9f447877..3715be13b 100644 --- a/ui/component/fileThumbnail/index.js +++ b/ui/component/fileThumbnail/index.js @@ -1,16 +1,25 @@ import { connect } from 'react-redux'; import { doResolveUri } from 'redux/actions/claims'; import { makeSelectClaimForUri } from 'redux/selectors/claims'; -import { makeSelectContentWatchedPercentageForUri } from 'redux/selectors/content'; +import { selectPrimaryUri, makeSelectContentWatchedPercentageForUri } from 'redux/selectors/content'; import CardMedia from './view'; import { makeSelectClientSetting } from 'redux/selectors/settings'; import * as SETTINGS from 'constants/settings'; const select = (state, props) => { + const claimUriBeingPlayed = selectPrimaryUri(state); + let isBeingPlayed = false; + + if (claimUriBeingPlayed) { + const claim = makeSelectClaimForUri(props.uri)(state); + const claimBeingPlayed = makeSelectClaimForUri(claimUriBeingPlayed)(state); + isBeingPlayed = claim.claim_id === claimBeingPlayed.claim_id; + } + return { watchedPercentage: makeSelectContentWatchedPercentageForUri(props.uri)(state), claim: makeSelectClaimForUri(props.uri)(state), - showPercentage: makeSelectClientSetting(SETTINGS.PERSIST_WATCH_TIME)(state), + showPercentage: !isBeingPlayed && makeSelectClientSetting(SETTINGS.PERSIST_WATCH_TIME)(state), }; };