fix error on opening related content or urls

This commit is contained in:
Akinwale Ariwodola 2020-01-14 02:29:30 +01:00
parent 683b1f4805
commit 156e310368

View file

@ -677,13 +677,16 @@ class FilePage extends React.PureComponent {
getPurchaseUrl = () => {
const { claim, navigation } = this.props;
const { permanent_url: permanentUrl } = claim;
const permanentUrl = claim ? claim.permanent_url : null;
let purchaseUrl;
if (navigation.state.params) {
const { uri, fullUri } = navigation.state.params;
purchaseUrl = fullUri || uri || permanentUrl;
}
if (!purchaseUrl && permanentUrl) {
purchaseUrl = permanentUrl;
}
return purchaseUrl;
};