Commit Graph

17 Commits

Author SHA1 Message Date
c0mrade
2dab25c5a0 fix: resolve telegram auth token expiration and clean up codebase
- Fix stale initData comparison in clearStaleSessionIfNeeded that destroyed
  valid refresh tokens on mobile WebView reopens
- Restrict X-Telegram-Init-Data header to auth endpoints only
- Close Mini App on auth retry to force fresh initData from Telegram
- Merge Connection page error/not-configured states for better UX
- Remove unnecessary comments across 40+ files (section dividers,
  restating comments, noise catch block comments)
- Configure ESLint allowEmptyCatch to properly handle intentional
  empty catch blocks (62 warnings resolved)
2026-03-13 17:50:49 +03:00
Fringg
01e811bdfc fix: handle Telegram Stars payment for gift subscriptions via openInvoice
- Use openInvoice() with capabilities.hasInvoice guard for Stars payments
- Fall back to redirect for web environments without invoice support
- Add haptic feedback on payment success/failure
2026-03-12 03:32:14 +03:00
Fringg
03c9e73a37 feat: display promo group and active discount banners on gift page
Add promo group banner (green) and active discount banner (orange) to
gift subscription page. PeriodCard now shows original price strikethrough
and discount percentage badge from server-calculated values.
2026-03-11 02:58:43 +03:00
Fringg
39bdf8b5c3 fix: CopiedToast not visible due to CSS transform context
Use createPortal to render toast at document.body level,
escaping framer-motion's transform on the tab content wrapper.
Remove unused useRef import and shareToastTapCopy i18n key.
2026-03-10 07:39:04 +03:00
Fringg
9fbfcf21ff refactor: replace share modal with auto-copy toast
Remove the full-screen ShareModal dialog that appeared when sharing a
gift code. Replace with a bottom toast that automatically copies the
share message to clipboard on button press and slides up from the
bottom. The toast auto-dismisses after 5 seconds and can be tapped
to copy again.
2026-03-10 07:27:39 +03:00
Fringg
7945071893 refactor: rename GIFTCODE_ start parameter prefix to GIFT_ 2026-03-10 06:48:57 +03:00
Fringg
7549ae70eb feat: show localized error for self-activation attempt 2026-03-10 06:45:14 +03:00
Fringg
51ec799c0c feat: split my gifts into Active/Activated/Received sections
Sent gifts are now sorted into "Active gifts" (awaiting activation)
and "Activated" (already used). Received gifts remain separate.
2026-03-10 06:39:50 +03:00
Fringg
73d67bceed fix: use short 12-char code in bot and cabinet share links
GIFTCODE_ prefix (9 chars) + full 64-char token = 73 chars,
exceeding Telegram's 64-char start parameter limit. Now all
share links use the same short code shown in the UI (first 12
chars). Backend already supports prefix-based lookup.
2026-03-10 06:30:49 +03:00
Fringg
b213535738 fix: remove dark backdrop overlay from share modal 2026-03-10 06:25:06 +03:00
Fringg
a627eb0b30 fix: gift code display + share modal backdrop
- Don't uppercase gift codes (tokens are case-sensitive base64)
- Lighten share modal backdrop (bg-dark-900/40 instead of bg-black/60)
2026-03-10 06:20:29 +03:00
Fringg
d852bfe969 fix: activation broken — token uppercased + wrong env var for bot username
- Remove .toUpperCase() from activation code input — tokens are case-sensitive base64
- Fix VITE_BOT_USERNAME → VITE_TELEGRAM_BOT_USERNAME (correct env var name)
- Add Escape key handler, scroll lock, role="dialog" to ShareModal
2026-03-10 06:13:50 +03:00
Fringg
1bafcca1ef fix: gift UI improvements — declension, GB display, share modal, deep links
- Fix Russian device count declension (_one/_few/_many)
- Show traffic GB and tariff description in buy tab
- Replace copy/share buttons with share modal (bot + cabinet links)
- GiftResult: code-only success state with formatted share message
- Support ?tab=activate&code=TOKEN for auto-activation via cabinet link
- Add is_code_only + purchase_token to API types
2026-03-10 06:03:28 +03:00
Fringg
af3e535c69 feat: gift subscription redesign — code-only purchase + 3-tab UI
- Remove recipient input from buy flow (code-only gifts)
- 3-tab UI: Buy, Activate, My Gifts with animations
- After purchase, switch to My Gifts tab to show gift code
- Gift code display with copy/share buttons
- Activate tab: enter gift code to activate subscription
- My Gifts tab: sent/received gifts with status badges
- Fix: use navigator.language instead of hardcoded ru-RU for dates
- Fix: spread array before sort to prevent React Query cache mutation
- Fix: ARIA tab linkage with proper id/aria-labelledby
- Fix: guard VITE_BOT_USERNAME against undefined in share URLs
- Fix: wrap clipboard/share fallbacks in try/catch
- Add error state to MyGiftsTabContent
2026-03-10 05:37:57 +03:00
Fringg
c8ec221111 fix: remove bg-dark-950 from gift pages to preserve animated background 2026-03-09 21:03:05 +03:00
Fringg
6ea1de2e8a fix: harden gift subscription frontend after multi-agent review
- Handle expired status in GiftResult (stop polling + show FailedState)
- Add PollErrorState for balance mode poll errors (softer UX)
- Remove non-null assertions in handleSubmit (explicit narrowing)
- Wrap gift routes in ErrorBoundary
- Add pollErrorTitle/pollErrorDesc i18n keys to all 4 locales
2026-03-09 20:34:41 +03:00
Fringg
814b1f5e96 feat: add GiftSubscription and GiftResult pages 2026-03-09 18:56:16 +03:00