comment out lbry-first code

This commit is contained in:
Sean Yesmunt 2020-07-13 10:03:00 -04:00
parent 2cba296db2
commit 856cc41f39
2 changed files with 62 additions and 63 deletions

View file

@ -8,7 +8,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added ### Added
- Upload your files published via the desktop app to youtube ([#4491](https://github.com/lbryio/lbry-desktop/pull/4491))
- Add ability to sign supports ([#4382](https://github.com/lbryio/lbry-desktop/pull/4382)) - Add ability to sign supports ([#4382](https://github.com/lbryio/lbry-desktop/pull/4382))
- Add "tap to unmute" button for videos that start with audio muted _community pr!_ ([#4365](https://github.com/lbryio/lbry-desktop/pull/4365)) - Add "tap to unmute" button for videos that start with audio muted _community pr!_ ([#4365](https://github.com/lbryio/lbry-desktop/pull/4365))
- Allow upgrade bar to be dismissed per session _community pr!_ ([#4413](https://github.com/lbryio/lbry-desktop/pull/4413)) - Allow upgrade bar to be dismissed per session _community pr!_ ([#4413](https://github.com/lbryio/lbry-desktop/pull/4413))

View file

@ -4,12 +4,12 @@ import classnames from 'classnames';
import usePersistedState from 'effects/use-persisted-state'; import usePersistedState from 'effects/use-persisted-state';
import { FormField } from 'component/common/form'; import { FormField } from 'component/common/form';
import Button from 'component/button'; import Button from 'component/button';
import { LbryFirst } from 'lbry-redux';
import LicenseType from './license-type'; import LicenseType from './license-type';
import Card from 'component/common/card'; import Card from 'component/common/card';
import ErrorText from 'component/common/error-text';
// @if TARGET='app' // @if TARGET='app'
import { ipcRenderer } from 'electron'; // import ErrorText from 'component/common/error-text';
// import { LbryFirst } from 'lbry-redux';
// import { ipcRenderer } from 'electron';
// @endif // @endif
type Props = { type Props = {
@ -29,82 +29,82 @@ type Props = {
function PublishAdditionalOptions(props: Props) { function PublishAdditionalOptions(props: Props) {
const { const {
user,
language, language,
name, name,
licenseType, licenseType,
otherLicenseDescription, otherLicenseDescription,
licenseUrl, licenseUrl,
updatePublishForm, updatePublishForm,
useLBRYUploader, // user,
needsYTAuth, // useLBRYUploader,
accessToken, // needsYTAuth,
fetchAccessToken, // accessToken,
// fetchAccessToken,
} = props; } = props;
const [hideSection, setHideSection] = usePersistedState('publish-advanced-options', true); const [hideSection, setHideSection] = usePersistedState('publish-advanced-options', true);
const [hasLaunchedLbryFirst, setHasLaunchedLbryFirst] = React.useState(false); // const [hasLaunchedLbryFirst, setHasLaunchedLbryFirst] = React.useState(false);
const [ytError, setYtError] = React.useState(false); // const [ytError, setYtError] = React.useState(false);
const isLBRYFirstUser = user && user.lbry_first_approved; // const isLBRYFirstUser = user && user.lbry_first_approved;
const showLbryFirstCheckbox = !IS_WEB && isLBRYFirstUser && hasLaunchedLbryFirst; // const showLbryFirstCheckbox = !IS_WEB && isLBRYFirstUser && hasLaunchedLbryFirst;
function toggleHideSection() { function toggleHideSection() {
setHideSection(!hideSection); setHideSection(!hideSection);
} }
// @if TARGET='app' // @if TARGET='app'
function signup() { // function signup() {
updatePublishForm({ ytSignupPending: true }); // updatePublishForm({ ytSignupPending: true });
LbryFirst.ytSignup() // LbryFirst.ytSignup()
.then(response => { // .then(response => {
updatePublishForm({ needsYTAuth: false, ytSignupPending: false }); // updatePublishForm({ needsYTAuth: false, ytSignupPending: false });
}) // })
.catch(error => { // .catch(error => {
updatePublishForm({ ytSignupPending: false }); // updatePublishForm({ ytSignupPending: false });
setYtError(true); // setYtError(true);
console.error(error); // eslint-disable-line // console.error(error); // eslint-disable-line
}); // });
} // }
function unlink() { // function unlink() {
setYtError(false); // setYtError(false);
LbryFirst.remove() // LbryFirst.remove()
.then(response => { // .then(response => {
updatePublishForm({ needsYTAuth: true }); // updatePublishForm({ needsYTAuth: true });
}) // })
.catch(error => { // .catch(error => {
setYtError(true); // setYtError(true);
console.error(error); // eslint-disable-line // console.error(error); // eslint-disable-line
}); // });
} // }
React.useEffect(() => { // React.useEffect(() => {
if (!accessToken) { // if (!accessToken) {
fetchAccessToken(); // fetchAccessToken();
} // }
}, [accessToken, fetchAccessToken]); // }, [accessToken, fetchAccessToken]);
React.useEffect(() => { // React.useEffect(() => {
if (isLBRYFirstUser && !hasLaunchedLbryFirst) { // if (isLBRYFirstUser && !hasLaunchedLbryFirst) {
ipcRenderer.send('launch-lbry-first'); // ipcRenderer.send('launch-lbry-first');
ipcRenderer.on('lbry-first-launched', () => { // ipcRenderer.on('lbry-first-launched', () => {
setHasLaunchedLbryFirst(true); // setHasLaunchedLbryFirst(true);
}); // });
} // }
}, [isLBRYFirstUser, hasLaunchedLbryFirst, setHasLaunchedLbryFirst]); // }, [isLBRYFirstUser, hasLaunchedLbryFirst, setHasLaunchedLbryFirst]);
React.useEffect(() => { // React.useEffect(() => {
if (useLBRYUploader && isLBRYFirstUser && hasLaunchedLbryFirst && accessToken) { // if (useLBRYUploader && isLBRYFirstUser && hasLaunchedLbryFirst && accessToken) {
LbryFirst.hasYTAuth(accessToken) // LbryFirst.hasYTAuth(accessToken)
.then(response => { // .then(response => {
updatePublishForm({ needsYTAuth: !response.HasAuth }); // updatePublishForm({ needsYTAuth: !response.HasAuth });
}) // })
.catch(error => { // .catch(error => {
setYtError(true); // setYtError(true);
console.error(error); // eslint-disable-line // console.error(error); // eslint-disable-line
}); // });
} // }
}, [updatePublishForm, useLBRYUploader, isLBRYFirstUser, hasLaunchedLbryFirst, accessToken]); // }, [updatePublishForm, useLBRYUploader, isLBRYFirstUser, hasLaunchedLbryFirst, accessToken]);
// @endif // @endif
return ( return (
@ -114,7 +114,7 @@ function PublishAdditionalOptions(props: Props) {
{!hideSection && ( {!hideSection && (
<div className={classnames({ 'card--disabled': !name })}> <div className={classnames({ 'card--disabled': !name })}>
{/* @if TARGET='app' */} {/* @if TARGET='app' */}
{showLbryFirstCheckbox && ( {/* {showLbryFirstCheckbox && (
<div className="section"> <div className="section">
<> <>
<FormField <FormField
@ -146,7 +146,7 @@ function PublishAdditionalOptions(props: Props) {
)} )}
</> </>
</div> </div>
)} )} */}
{/* @endif */} {/* @endif */}
<div className="section"> <div className="section">
<FormField <FormField