diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index 3562ba339..45623462d 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -121,7 +121,6 @@ function App(props: Props) { const urlParams = new URLSearchParams(search); const rawReferrerParam = urlParams.get('r'); const sanitizedReferrerParam = rawReferrerParam && rawReferrerParam.replace(':', '#'); - const wrapperElement = appRef.current; const shouldHideNag = pathname.startsWith(`/$/${PAGES.EMBED}`) || pathname.startsWith(`/$/${PAGES.AUTH_VERIFY}`); let uri; @@ -172,6 +171,7 @@ function App(props: Props) { }, [sanitizedReferrerParam, isRewardApproved, referredRewardAvailable]); useEffect(() => { + const { current: wrapperElement } = appRef; if (wrapperElement) { ReactModal.setAppElement(wrapperElement); } @@ -181,7 +181,7 @@ function App(props: Props) { fetchTransactions(1, TX_LIST.LATEST_PAGE_SIZE); fetchChannelListMine(); // This needs to be done for web too... // @endif - }, [fetchTransactions, fetchAccessToken, fetchChannelListMine, wrapperElement]); + }, [appRef, fetchAccessToken, fetchChannelListMine, fetchTransactions]); useEffect(() => { // $FlowFixMe diff --git a/ui/component/fileViewerInitiator/view.jsx b/ui/component/fileViewerInitiator/view.jsx index 73393f12c..60f88412d 100644 --- a/ui/component/fileViewerInitiator/view.jsx +++ b/ui/component/fileViewerInitiator/view.jsx @@ -10,6 +10,7 @@ import isUserTyping from 'util/detect-typing'; import Yrbl from 'component/yrbl'; import I18nMessage from 'component/i18nMessage'; import { generateDownloadUrl } from 'util/lbrytv'; +import { FORCE_CONTENT_TYPE_PLAYER } from 'constants/claim'; const SPACE_BAR_KEYCODE = 32; @@ -54,7 +55,7 @@ export default function FileViewerInitiator(props: Props) { claim, } = props; const cost = costInfo && costInfo.cost; - const forceVideo = ['application/x-ext-mkv', 'video/x-matroska'].includes(contentType); + const forceVideo = FORCE_CONTENT_TYPE_PLAYER.includes(contentType); const isPlayable = ['audio', 'video'].includes(mediaType) || forceVideo; const isImage = mediaType === 'image'; const fileStatus = fileInfo && fileInfo.status; @@ -114,7 +115,7 @@ export default function FileViewerInitiator(props: Props) { if (((autoplay && !videoOnPage && isAutoPlayable) || isText || isImage) && hasCostInfo && cost === 0) { viewFile(); } - }, [autoplay, viewFile, isAutoPlayable, hasCostInfo, cost, isText]); + }, [autoplay, viewFile, isAutoPlayable, hasCostInfo, cost, isText, isImage]); return (
{ - const videoNode = videoRef.current; + const { current: videoNode } = videoRef; const videoJsOptions = { ...VIDEO_JS_OPTIONS, sources: [ { src: source, - type: forceMp4 ? 'video/mp4' : contentType, + type: forcePlayer ? 'video/mp4' : contentType, }, ], plugins: { eventTracking: true }, @@ -182,7 +173,7 @@ function VideoViewer(props: Props) { useEffect(() => { function handleKeyDown(e: KeyboardEvent) { - const videoNode = videoRef.current; + const { current: videoNode } = videoRef; if (!videoNode || isUserTyping()) { return; @@ -225,7 +216,7 @@ function VideoViewer(props: Props) { }; // include requireRedraw here so the event listener is re-added when we need to manually remove/add the video player - }, [videoRef, requireRedraw]); + }, [videoRef, requireRedraw, player]); // player analytics useEffect(() => { @@ -249,7 +240,7 @@ function VideoViewer(props: Props) { player.off(); } }; - }, [player]); + }, [claimId, player]); useEffect(() => { if (player && position) { diff --git a/ui/constants/claim.js b/ui/constants/claim.js index c07ef6fd0..c9365e456 100644 --- a/ui/constants/claim.js +++ b/ui/constants/claim.js @@ -1,4 +1,4 @@ -export const MINIMUM_PUBLISH_BID = 0.00001000; +export const MINIMUM_PUBLISH_BID = 0.00001; export const CHANNEL_ANONYMOUS = 'anonymous'; export const CHANNEL_NEW = 'new'; @@ -6,3 +6,17 @@ export const PAGE_SIZE = 20; export const INVALID_NAME_ERROR = __('LBRY names cannot contain spaces or reserved symbols') + ' ' + '($#@;/"<>%{}|^~[]`)'; + +export const FORCE_CONTENT_TYPE_PLAYER = [ + 'video/quicktime', + 'application/x-ext-mkv', + 'video/x-matroska', + 'application/octet-stream', + 'video/x-ms-wmv', + 'video/x-msvideo', + 'video/mpeg', + 'video/m4v', + 'audio/ogg', + 'application/x-ext-ogg', + 'application/x-ext-m4a', +]; diff --git a/ui/redux/actions/app.js b/ui/redux/actions/app.js index 7ba81b959..846096ba3 100644 --- a/ui/redux/actions/app.js +++ b/ui/redux/actions/app.js @@ -367,8 +367,9 @@ export function doClearCache() { // Leaving for now // const reducersToClear = whiteListedReducers.filter(reducerKey => reducerKey !== 'tags'); // window.cacheStore.purge(reducersToClear); - window.localStorage.clear(); + window.sessionStorage.clear(); dispatch(doClearSupport()); + window.location.reload(); return dispatch(doClearPublish()); }; } diff --git a/ui/redux/actions/file.js b/ui/redux/actions/file.js index 1c6fb021c..48b9b9a36 100644 --- a/ui/redux/actions/file.js +++ b/ui/redux/actions/file.js @@ -46,13 +46,14 @@ export function doDeleteFile(outpoint, deleteFromComputer, abandonClaim) { dispatch(doAbandonClaim(txid, Number(nout))); } - + // @if TARGET='app' dispatch({ type: ACTIONS.FILE_DELETE, data: { outpoint, }, }); + // @endif }; }