From 1d347d2c6b8ad491b9cf9c5f419f6b4cc1c8556b Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 3 May 2018 01:20:31 -0400 Subject: [PATCH] Revert "Remove price placeholder during thumbnail loading" --- CHANGELOG.md | 1 - src/renderer/component/filePrice/view.jsx | 18 +++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9c7a5ec8..732c263be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Changed * 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 * Black screen on macOS after maximizing LBRY and then closing ([#1235](https://github.com/lbryio/lbry-app/pull/1235)) diff --git a/src/renderer/component/filePrice/view.jsx b/src/renderer/component/filePrice/view.jsx index ca926cf6f..090c93126 100644 --- a/src/renderer/component/filePrice/view.jsx +++ b/src/renderer/component/filePrice/view.jsx @@ -16,17 +16,29 @@ class FilePrice extends React.PureComponent { showFullPrice: false, }; - render() { - const { claim, costInfo, fetchCostInfo, fetching, showFullPrice, uri } = this.props; + componentWillMount() { + 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) { fetchCostInfo(uri); } + }; + + render() { + const { costInfo, showFullPrice } = this.props; const isEstimate = costInfo ? !costInfo.includesData : false; if (!costInfo) { - return null; + return PRICE; } return (