pending and publish

This commit is contained in:
zeppi 2021-03-25 15:59:25 -04:00 committed by jessopb
parent 7fdc3d2919
commit da60104c96
2 changed files with 7 additions and 5 deletions

View file

@ -8,7 +8,7 @@
File upload is carried out in the background by that function. File upload is carried out in the background by that function.
*/ */
import { SITE_NAME, ENABLE_NO_SOURCE_CLAIMS } from 'config'; import { SITE_NAME, ENABLE_NO_SOURCE_CLAIMS, SIMPLE_SITE } from 'config';
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { buildURI, isURIValid, isNameValid, THUMBNAIL_STATUSES } from 'lbry-redux'; import { buildURI, isURIValid, isNameValid, THUMBNAIL_STATUSES } from 'lbry-redux';
import Button from 'component/button'; import Button from 'component/button';
@ -123,7 +123,7 @@ function PublishForm(props: Props) {
: Object.values(PUBLISH_MODES).filter((mode) => mode !== PUBLISH_MODES.LIVESTREAM); : Object.values(PUBLISH_MODES).filter((mode) => mode !== PUBLISH_MODES.LIVESTREAM);
const MODE_TO_I18N_STR = { const MODE_TO_I18N_STR = {
[PUBLISH_MODES.FILE]: 'File', [PUBLISH_MODES.FILE]: SIMPLE_SITE ? 'Video' : 'File',
[PUBLISH_MODES.POST]: 'Post --[noun, markdown post tab button]--', [PUBLISH_MODES.POST]: 'Post --[noun, markdown post tab button]--',
[PUBLISH_MODES.LIVESTREAM]: 'Livestream --[noun, livestream tab button]--', [PUBLISH_MODES.LIVESTREAM]: 'Livestream --[noun, livestream tab button]--',
}; };

View file

@ -58,8 +58,10 @@ export default function LivestreamSetupPage(props: Props) {
} }
const [livestreamClaims, setLivestreamClaims] = React.useState([]); const [livestreamClaims, setLivestreamClaims] = React.useState([]);
// $FlowFixMe const pendingLiveStreamClaims =
const pendingLiveStreamClaims = pendingClaims.filter((claim) => !(claim && claim.value && claim.value.source)); // $FlowFixMe
pendingClaims ? pendingClaims.filter((claim) => !(claim && claim.value && claim.value.source)) : [];
const pendingLength = pendingLiveStreamClaims.length;
const totalLivestreamClaims = pendingLiveStreamClaims.concat(livestreamClaims); const totalLivestreamClaims = pendingLiveStreamClaims.concat(livestreamClaims);
React.useEffect(() => { React.useEffect(() => {
@ -82,7 +84,7 @@ export default function LivestreamSetupPage(props: Props) {
.catch(() => { .catch(() => {
setLivestreamClaims([]); setLivestreamClaims([]);
}); });
}, [activeChannelClaimStr]); }, [activeChannelClaimStr, pendingLength]);
return ( return (
<Page> <Page>