More release blockers #1490
|
@ -5,7 +5,6 @@ import {
|
|||
makeSelectLoadingForUri,
|
||||
makeSelectCostInfoForUri,
|
||||
} from 'lbry-redux';
|
||||
import { doFetchAvailability } from 'redux/actions/availability';
|
||||
import { doOpenFileInShell } from 'redux/actions/file';
|
||||
import { doPurchaseUri, doStartDownload } from 'redux/actions/content';
|
||||
import { doPause } from 'redux/actions/media';
|
||||
|
@ -20,7 +19,6 @@ const select = (state, props) => ({
|
|||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
checkAvailability: uri => dispatch(doFetchAvailability(uri)),
|
||||
openInShell: path => dispatch(doOpenFileInShell(path)),
|
||||
purchaseUri: uri => dispatch(doPurchaseUri(uri)),
|
||||
restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)),
|
||||
|
|
|
@ -11,31 +11,19 @@ type Props = {
|
|||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
total_bytes: number,
|
||||
outpoint: number,
|
||||
download_path: string,
|
||||
completed: boolean,
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
},
|
||||
loading: boolean,
|
||||
costInfo: ?{},
|
||||
restartDownload: (string, number) => void,
|
||||
checkAvailability: string => void,
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
openInShell: string => void,
|
||||
purchaseUri: string => void,
|
||||
doPause: () => void,
|
||||
};
|
||||
|
||||
class FileDownloadLink extends React.PureComponent<Props> {
|
||||
componentWillMount() {
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
this.checkAvailability(this.props.uri);
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
}
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
componentWillReceiveProps(nextProps: Props) {
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
this.checkAvailability(nextProps.uri);
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
this.restartDownload(nextProps);
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
}
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
uri: ?string;
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
restartDownload = (props: Props) => {
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
const { downloading, fileInfo, uri, restartDownload } = props;
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
componentWillUpdate() {
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
const { downloading, fileInfo, uri, restartDownload } = this.props;
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
if (
|
||||
!downloading &&
|
||||
fileInfo &&
|
||||
|
@ -45,15 +33,10 @@ class FileDownloadLink extends React.PureComponent<Props> {
|
|||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
) {
|
||||
restartDownload(uri, fileInfo.outpoint);
|
||||
}
|
||||
};
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
checkAvailability(uri: string) {
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
if (!this.uri || uri !== this.uri) {
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
this.uri = uri;
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
this.props.checkAvailability(uri);
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
}
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
}
|
||||
|
||||
uri: ?string;
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
|
||||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
||||
render() {
|
||||
const {
|
||||
fileInfo,
|
||||
|
|
|||
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps
|
componentWillReceiveProps is being deprecated in favor of getDerivedStateFromProps