comment out lbry-first code
This commit is contained in:
parent
2cba296db2
commit
856cc41f39
2 changed files with 62 additions and 63 deletions
|
@ -8,7 +8,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
### 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 "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))
|
||||
|
|
|
@ -4,12 +4,12 @@ import classnames from 'classnames';
|
|||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import { FormField } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import { LbryFirst } from 'lbry-redux';
|
||||
import LicenseType from './license-type';
|
||||
import Card from 'component/common/card';
|
||||
import ErrorText from 'component/common/error-text';
|
||||
// @if TARGET='app'
|
||||
import { ipcRenderer } from 'electron';
|
||||
// import ErrorText from 'component/common/error-text';
|
||||
// import { LbryFirst } from 'lbry-redux';
|
||||
// import { ipcRenderer } from 'electron';
|
||||
// @endif
|
||||
|
||||
type Props = {
|
||||
|
@ -29,82 +29,82 @@ type Props = {
|
|||
|
||||
function PublishAdditionalOptions(props: Props) {
|
||||
const {
|
||||
user,
|
||||
language,
|
||||
name,
|
||||
licenseType,
|
||||
otherLicenseDescription,
|
||||
licenseUrl,
|
||||
updatePublishForm,
|
||||
useLBRYUploader,
|
||||
needsYTAuth,
|
||||
accessToken,
|
||||
fetchAccessToken,
|
||||
// user,
|
||||
// useLBRYUploader,
|
||||
// needsYTAuth,
|
||||
// accessToken,
|
||||
// fetchAccessToken,
|
||||
} = props;
|
||||
const [hideSection, setHideSection] = usePersistedState('publish-advanced-options', true);
|
||||
const [hasLaunchedLbryFirst, setHasLaunchedLbryFirst] = React.useState(false);
|
||||
const [ytError, setYtError] = React.useState(false);
|
||||
const isLBRYFirstUser = user && user.lbry_first_approved;
|
||||
const showLbryFirstCheckbox = !IS_WEB && isLBRYFirstUser && hasLaunchedLbryFirst;
|
||||
// const [hasLaunchedLbryFirst, setHasLaunchedLbryFirst] = React.useState(false);
|
||||
// const [ytError, setYtError] = React.useState(false);
|
||||
// const isLBRYFirstUser = user && user.lbry_first_approved;
|
||||
// const showLbryFirstCheckbox = !IS_WEB && isLBRYFirstUser && hasLaunchedLbryFirst;
|
||||
|
||||
function toggleHideSection() {
|
||||
setHideSection(!hideSection);
|
||||
}
|
||||
|
||||
// @if TARGET='app'
|
||||
function signup() {
|
||||
updatePublishForm({ ytSignupPending: true });
|
||||
LbryFirst.ytSignup()
|
||||
.then(response => {
|
||||
updatePublishForm({ needsYTAuth: false, ytSignupPending: false });
|
||||
})
|
||||
.catch(error => {
|
||||
updatePublishForm({ ytSignupPending: false });
|
||||
setYtError(true);
|
||||
console.error(error); // eslint-disable-line
|
||||
});
|
||||
}
|
||||
// function signup() {
|
||||
// updatePublishForm({ ytSignupPending: true });
|
||||
// LbryFirst.ytSignup()
|
||||
// .then(response => {
|
||||
// updatePublishForm({ needsYTAuth: false, ytSignupPending: false });
|
||||
// })
|
||||
// .catch(error => {
|
||||
// updatePublishForm({ ytSignupPending: false });
|
||||
// setYtError(true);
|
||||
// console.error(error); // eslint-disable-line
|
||||
// });
|
||||
// }
|
||||
|
||||
function unlink() {
|
||||
setYtError(false);
|
||||
// function unlink() {
|
||||
// setYtError(false);
|
||||
|
||||
LbryFirst.remove()
|
||||
.then(response => {
|
||||
updatePublishForm({ needsYTAuth: true });
|
||||
})
|
||||
.catch(error => {
|
||||
setYtError(true);
|
||||
console.error(error); // eslint-disable-line
|
||||
});
|
||||
}
|
||||
// LbryFirst.remove()
|
||||
// .then(response => {
|
||||
// updatePublishForm({ needsYTAuth: true });
|
||||
// })
|
||||
// .catch(error => {
|
||||
// setYtError(true);
|
||||
// console.error(error); // eslint-disable-line
|
||||
// });
|
||||
// }
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!accessToken) {
|
||||
fetchAccessToken();
|
||||
}
|
||||
}, [accessToken, fetchAccessToken]);
|
||||
// React.useEffect(() => {
|
||||
// if (!accessToken) {
|
||||
// fetchAccessToken();
|
||||
// }
|
||||
// }, [accessToken, fetchAccessToken]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (isLBRYFirstUser && !hasLaunchedLbryFirst) {
|
||||
ipcRenderer.send('launch-lbry-first');
|
||||
ipcRenderer.on('lbry-first-launched', () => {
|
||||
setHasLaunchedLbryFirst(true);
|
||||
});
|
||||
}
|
||||
}, [isLBRYFirstUser, hasLaunchedLbryFirst, setHasLaunchedLbryFirst]);
|
||||
// React.useEffect(() => {
|
||||
// if (isLBRYFirstUser && !hasLaunchedLbryFirst) {
|
||||
// ipcRenderer.send('launch-lbry-first');
|
||||
// ipcRenderer.on('lbry-first-launched', () => {
|
||||
// setHasLaunchedLbryFirst(true);
|
||||
// });
|
||||
// }
|
||||
// }, [isLBRYFirstUser, hasLaunchedLbryFirst, setHasLaunchedLbryFirst]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (useLBRYUploader && isLBRYFirstUser && hasLaunchedLbryFirst && accessToken) {
|
||||
LbryFirst.hasYTAuth(accessToken)
|
||||
.then(response => {
|
||||
updatePublishForm({ needsYTAuth: !response.HasAuth });
|
||||
})
|
||||
.catch(error => {
|
||||
setYtError(true);
|
||||
console.error(error); // eslint-disable-line
|
||||
});
|
||||
}
|
||||
}, [updatePublishForm, useLBRYUploader, isLBRYFirstUser, hasLaunchedLbryFirst, accessToken]);
|
||||
// React.useEffect(() => {
|
||||
// if (useLBRYUploader && isLBRYFirstUser && hasLaunchedLbryFirst && accessToken) {
|
||||
// LbryFirst.hasYTAuth(accessToken)
|
||||
// .then(response => {
|
||||
// updatePublishForm({ needsYTAuth: !response.HasAuth });
|
||||
// })
|
||||
// .catch(error => {
|
||||
// setYtError(true);
|
||||
// console.error(error); // eslint-disable-line
|
||||
// });
|
||||
// }
|
||||
// }, [updatePublishForm, useLBRYUploader, isLBRYFirstUser, hasLaunchedLbryFirst, accessToken]);
|
||||
// @endif
|
||||
|
||||
return (
|
||||
|
@ -114,7 +114,7 @@ function PublishAdditionalOptions(props: Props) {
|
|||
{!hideSection && (
|
||||
<div className={classnames({ 'card--disabled': !name })}>
|
||||
{/* @if TARGET='app' */}
|
||||
{showLbryFirstCheckbox && (
|
||||
{/* {showLbryFirstCheckbox && (
|
||||
<div className="section">
|
||||
<>
|
||||
<FormField
|
||||
|
@ -146,7 +146,7 @@ function PublishAdditionalOptions(props: Props) {
|
|||
)}
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
)} */}
|
||||
{/* @endif */}
|
||||
<div className="section">
|
||||
<FormField
|
||||
|
|
Loading…
Reference in a new issue