Files
OpenFrontIO/resources/lang
Evan eae2be6458 feat(store): confirm plutonium and caps purchases before charging (#4510)
## Summary

Fixes #4218

Currency purchases (Plutonium and Caps) fired immediately on click with
no confirmation. This adds a confirmation modal — reusing the existing
`confirm-dialog` Lit component — that gates every currency purchase
behind an explicit "Confirm".

There were two paths that could trigger a currency purchase, and both
are now gated:

- **The Plutonium / Caps price buttons** — `PurchaseButton` no longer
calls `onPurchaseHard`/`onPurchaseSoft` directly; it opens a
`confirm-dialog` ("Buy {item} for {amount} {currency}?", warning
variant) and only runs the purchase on confirm. Cancel / backdrop click
dismisses.
- **Whole-card click** — `CosmeticContainer` auto-fires the purchase
when there's exactly one payment option, which bypassed the button
entirely for currency-only items. That path now delegates to the
purchase button's new `requestCurrencyPurchase()` so it goes through the
same dialog.

The existing purchase flow (busy guard, loading overlay,
insufficient-currency dialog) is unchanged and runs after confirmation.
Dollar purchases are untouched (they go through Stripe checkout, which
is its own confirmation step).

New i18n keys: `store.confirm_purchase_title`,
`store.confirm_purchase_body` (en.json only, per Crowdin convention).

## Test plan

- [x] ESLint, `tsc --noEmit`, Prettier pass
- [ ] Manual check in staging: click a Plutonium or Caps price button →
dialog appears with the right currency name and amount; confirm
purchases, cancel doesn't
- [ ] Manual check: click the card body of a currency-only item → same
dialog (not an instant purchase)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 18:52:17 -07:00
..
2026-05-31 19:55:50 -07:00
2026-03-02 10:54:37 -08:00
2026-04-17 17:31:43 -07:00
2026-02-11 14:42:59 -08:00
2026-02-11 14:42:59 -08:00
2026-06-13 08:39:35 -07:00
2026-03-02 10:54:37 -08:00
2026-06-13 08:39:35 -07:00
2026-06-13 08:39:35 -07:00
2026-06-13 08:39:35 -07:00
2026-04-17 17:31:43 -07:00
2026-06-13 08:39:35 -07:00
2026-03-02 10:54:37 -08:00
2026-02-11 14:42:59 -08:00
2026-02-11 14:42:59 -08:00
2026-06-13 08:39:35 -07:00
2026-02-11 14:42:59 -08:00
2026-06-13 08:39:35 -07:00
2026-05-31 19:55:50 -07:00