Fix hidden purchases through embeds
## Issue
1345
## Change
The refactor in 04c5ac46
broke the logic, because `!hasCost` would incorrectly include an undefined `costInfo` (haven't fetched) as free content.
This commit is contained in:
parent
3f805a6189
commit
cfc34c5dba
1 changed files with 2 additions and 2 deletions
|
@ -142,10 +142,10 @@ export default function EmbedWrapperPage(props: Props) {
|
|||
doResolveUri(uri);
|
||||
}
|
||||
|
||||
if (uri && haveClaim && !hasCost) {
|
||||
if (uri && haveClaim && costInfo && costInfo.cost === 0) {
|
||||
doPlayUri(uri);
|
||||
}
|
||||
}, [doPlayUri, doResolveUri, hasCost, haveClaim, uri]);
|
||||
}, [doPlayUri, doResolveUri, haveClaim, costInfo, uri]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (haveClaim && uri && doFetchCostInfoForUri) {
|
||||
|
|
Loading…
Reference in a new issue