fix: plugin price display#2120
Conversation
Greptile SummaryThis PR fixes plugin price display by replacing the hardcoded Indian Rupee symbol (
Confidence Score: 5/5Safe to merge — both changed files handle the dynamic currency symbol correctly with no crash paths. The change is a narrow, well-scoped fix: the hardcoded rupee symbol is replaced with an API-supplied field, the nullish-coalescing fallback in No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[API Response] --> B{currencySymbol present?}
B -->|Yes| C["price = currencySymbol + price\ne.g. '$9.99'"]
B -->|No| D["price = '' + price\ne.g. '9.99'"]
C --> E{IAP Available?}
D --> E
E -->|Yes| F["price = product.price\n(store-formatted string)"]
E -->|No| G[Use assembled price string]
F --> H[plugin.view.js renders price]
G --> H
A --> I["plugins.js: Item {...plugin}"]
I --> J{currencySymbol in spread?}
J -->|Yes| K["Renders: {currencySymbol}{price}"]
J -->|No| L["Renders: {price} only\n(undefined silently dropped)"]
Reviews (2): Last reviewed commit: "fix: currency rendering" | Re-trigger Greptile |
| isPaid = remotePlugin.price > 0; | ||
| purchased = remotePlugin.owned; | ||
| price = `₹ ${remotePlugin.price}`; | ||
| price = `${remotePlugin.currencySymbol}${remotePlugin.price}`; |
There was a problem hiding this comment.
Missing fallback for undefined currencySymbol
If remotePlugin.currencySymbol is undefined or null (e.g., the field is absent from the API response), the template literal produces the literal string "undefined100" or "null100", which gets rendered verbatim in the plugin detail UI. On non-IAP platforms the IAP code path never runs to overwrite price, so this broken string persists. A nullish-coalescing fallback makes it safe: `${remotePlugin.currencySymbol ?? ""}${remotePlugin.price}`.
|
@greptile_apps review |
No description provided.