Skip to content

Commit

Permalink
fix: correct isDownloadable docs to match impl (#18748)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere authored and MarshallOfSound committed Jun 13, 2019
1 parent 63d9948 commit 0e0c3da
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion atom/browser/api/atom_api_in_app_purchase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct Converter<in_app_purchase::Product> {
dict.Set("formattedPrice", val.formattedPrice);

// Downloadable Content Information
dict.Set("isDownloadable", val.downloadable);
dict.Set("isDownloadable", val.isDownloadable);

return dict.GetHandle();
}
Expand Down
2 changes: 1 addition & 1 deletion atom/browser/mac/in_app_purchase_product.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct Product {
std::string formattedPrice;

// Downloadable Content Information
bool downloadable = false;
bool isDownloadable = false;

Product(const Product&);
Product();
Expand Down
8 changes: 3 additions & 5 deletions atom/browser/mac/in_app_purchase_product.mm
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,13 @@ - (NSString*)formatPrice:(NSDecimalNumber*)price

if (product.priceLocale != nil) {
productStruct.formattedPrice =
[[self formatPrice:product.price withLocal:product.priceLocale]
UTF8String];
[[self formatPrice:product.price
withLocal:product.priceLocale] UTF8String];
}
}

// Downloadable Content Information
if (product.downloadable == true) {
productStruct.downloadable = true;
}
productStruct.isDownloadable = [product downloadable];

return productStruct;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/structures/product.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* `contentLengths` Number[] - The total size of the content, in bytes.
* `price` Number - The cost of the product in the local currency.
* `formattedPrice` String - The locale formatted price of the product.
* `downloadable` Boolean - A Boolean value that indicates whether the App Store has downloadable content for this product.
* `isDownloadable` Boolean - A Boolean value that indicates whether the App Store has downloadable content for this product. `true` if at least one file has been associated with the product.

0 comments on commit 0e0c3da

Please sign in to comment.