Merge pull request #1432 from lbryio/revert-1431-remove-price-placeholder
Revert "Remove price placeholder during thumbnail loading"
This commit is contained in:
commit
54c693767c
2 changed files with 15 additions and 4 deletions
|
@ -16,7 +16,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* Add flair to snackbar ([#1313](https://github.com/lbryio/lbry-app/pull/1313))
|
* Add flair to snackbar ([#1313](https://github.com/lbryio/lbry-app/pull/1313))
|
||||||
* Remove price placeholder during thumbnail loading ([#1431](https://github.com/lbryio/lbry-app/pull/1431))
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
* Black screen on macOS after maximizing LBRY and then closing ([#1235](https://github.com/lbryio/lbry-app/pull/1235))
|
* Black screen on macOS after maximizing LBRY and then closing ([#1235](https://github.com/lbryio/lbry-app/pull/1235))
|
||||||
|
|
|
@ -16,17 +16,29 @@ class FilePrice extends React.PureComponent<Props> {
|
||||||
showFullPrice: false,
|
showFullPrice: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
componentWillMount() {
|
||||||
const { claim, costInfo, fetchCostInfo, fetching, showFullPrice, uri } = this.props;
|
this.fetchCost(this.props);
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillReceiveProps(nextProps: Props) {
|
||||||
|
this.fetchCost(nextProps);
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchCost = (props: Props) => {
|
||||||
|
const { costInfo, fetchCostInfo, uri, fetching, claim } = props;
|
||||||
|
|
||||||
if (costInfo === undefined && !fetching && claim) {
|
if (costInfo === undefined && !fetching && claim) {
|
||||||
fetchCostInfo(uri);
|
fetchCostInfo(uri);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { costInfo, showFullPrice } = this.props;
|
||||||
|
|
||||||
const isEstimate = costInfo ? !costInfo.includesData : false;
|
const isEstimate = costInfo ? !costInfo.includesData : false;
|
||||||
|
|
||||||
if (!costInfo) {
|
if (!costInfo) {
|
||||||
return null;
|
return <span className="credit-amount">PRICE</span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in a new issue