Files
OpenFrontIO/resources
b379502516 fix(store): specific rate-limit message on tier change + use shared dialogs for subscription flows (#4622)
## Summary

- The change-tier API allows one tier change per minute per player
(`playerRateLimit` on `/subscriptions/@me/change-tier`). The client
previously lumped the 429 in with every other failure and showed
"Couldn't update your subscription. Please try again." — retrying
immediately just fails again. A 429 now gets its own message: *"You just
changed tiers. Please wait a minute before changing again."*
- Replaced all native `alert()` / `window.confirm()` calls in the
subscription flows with the shared `showInGameAlert` /
`showInGameConfirm` helpers (styled `<confirm-dialog>`, consistent with
the rest of the store, and safe on CrazyGames):
- Tier change: already-subscribed notice, upgrade/downgrade confirmation
(warning variant with "Change Tier" heading),
rate-limited/failure/success notices
  - Dollar checkout failures (first-time subscribe path)
- Subscription panel: cancel confirmation (danger variant), cancel
failure/success, portal-open failure

The currency-purchase alerts in Cosmetics.ts (`login_required`,
`purchase_failed`, `purchase_success`) are untouched — subscriptions
can't reach that path.

## Test plan

- [x] Typecheck, ESLint, Prettier
- [ ] Manual: change tier twice within a minute against the real API and
confirm the rate-limit dialog appears

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

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 12:35:33 -07:00
..
2026-01-09 20:26:34 -08:00
2025-09-30 13:18:03 -07:00
2025-12-09 16:12:00 -08:00
2025-09-28 17:47:05 -07:00
2025-05-29 11:07:04 -07:00
2026-05-31 15:09:08 +01:00
2026-01-09 20:26:34 -08:00