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.
This commit is contained in:
Fringg
2026-03-10 06:30:49 +03:00
parent b213535738
commit 73d67bceed
2 changed files with 7 additions and 11 deletions

View File

@@ -982,9 +982,10 @@ function ShareModal({ gift, onClose }: { gift: SentGift; onClose: () => void })
};
}, [onClose]);
const shortCode = gift.token.slice(0, 12);
const botUsername = import.meta.env.VITE_TELEGRAM_BOT_USERNAME as string | undefined;
const botLink = botUsername ? `https://t.me/${botUsername}?start=GIFTCODE_${gift.token}` : null;
const cabinetLink = `${window.location.origin}/gift?tab=activate&code=${gift.token}`;
const botLink = botUsername ? `https://t.me/${botUsername}?start=GIFTCODE_${shortCode}` : null;
const cabinetLink = `${window.location.origin}/gift?tab=activate&code=${shortCode}`;
const fullMessage = [
t('gift.shareText'),