From b50ec8fab1ba0c3d7b09cb7fc8272bf41130b178 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Sun, 15 Dec 2019 23:02:23 -0500 Subject: [PATCH] fix paid content message on lbry.tv --- ui/component/fileViewerInitiator/view.jsx | 12 ++++++++++-- yarn.lock | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ui/component/fileViewerInitiator/view.jsx b/ui/component/fileViewerInitiator/view.jsx index d841a2685..ecbea2f6f 100644 --- a/ui/component/fileViewerInitiator/view.jsx +++ b/ui/component/fileViewerInitiator/view.jsx @@ -51,7 +51,15 @@ export default function FileViewer(props: Props) { const isPlayable = ['audio', 'video'].includes(mediaType) || forceVideo; const fileStatus = fileInfo && fileInfo.status; const webStreamOnly = contentType === 'application/pdf' || mediaType === 'text'; - const supported = (IS_WEB && (isStreamable || webStreamOnly || forceVideo)) || !IS_WEB; + const supported = IS_WEB ? (!cost && isStreamable) || webStreamOnly || forceVideo : true; + + function getMessage() { + if (IS_WEB && cost) { + return __('Paid Content Not Supported on lbry.tv'); + } + + return __('Unsupported File'); + } // Wrap this in useCallback because we need to use it to the keyboard effect // If we don't a new instance will be created for every render and react will think the dependencies have changed, which will add/remove the listener for every render @@ -107,7 +115,7 @@ export default function FileViewer(props: Props) { {!supported && (

diff --git a/yarn.lock b/yarn.lock index 74dc78f00..d09f85307 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7092,9 +7092,9 @@ lazy-val@^1.0.4: yargs "^13.2.2" zstd-codec "^0.1.1" -lbry-redux@lbryio/lbry-redux#3452f38415ef88ad852c0838bf7fc46b856af5f8: +lbry-redux@lbryio/lbry-redux#e78c2a7e9fbacf39f73dd52fa0aa05f970973b98: version "0.0.1" - resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/3452f38415ef88ad852c0838bf7fc46b856af5f8" + resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/e78c2a7e9fbacf39f73dd52fa0aa05f970973b98" dependencies: proxy-polyfill "0.1.6" reselect "^3.0.0"