8881214213
Mechanical, behaviour-preserving removal of Stage N / TODO-N / phase (RN) references from comments, doc-comments, service READMEs, the current-state docs (ARCHITECTURE, FUNCTIONAL+_ru, TESTING, UI_DESIGN), config-file comments, and the .fbs/.proto schema comments. PLAN.md / PRERELEASE.md / CLAUDE.md keep the stage history. - Rename the only stage-named identifiers: registerStage8 -> registerSocialOps, registerStage11 -> registerLinkOps (gateway transcode). - Split stage6_test.go: TestEmailLoginFlow -> email_test.go, TestGuestAutoMatchLeavesNoStats (+ provisionGuest) -> account_test.go. - Regenerated proto bindings (push.pb.go, telegram_grpc.pb.go) from the de-staged .proto comments; FB Go/TS bindings unchanged (flatc strips schema comments). go build/vet/gofmt clean across modules; integration typecheck and pnpm check green.
21 lines
996 B
TypeScript
21 lines
996 B
TypeScript
// Pure helpers for the public landing page, kept out of the Svelte component so
|
|
// the per-language Telegram-channel link selection is unit-testable.
|
|
|
|
import type { Locale } from './i18n/index.svelte';
|
|
|
|
/**
|
|
* telegramChannelLink returns the t.me link for the locale's game channel, or null when it is
|
|
* not configured. The channel usernames are build-time vars (VITE_TELEGRAM_GAME_CHANNEL_NAME_EN
|
|
* / VITE_TELEGRAM_GAME_CHANNEL_NAME_RU) because the test and prod contours run different
|
|
* channels; they are the same channels the connector posts to via TELEGRAM_GAME_CHANNEL_ID_*
|
|
* (the id to post, the name to link). A leading "@" is tolerated.
|
|
*/
|
|
export function telegramChannelLink(locale: Locale): string | null {
|
|
const raw =
|
|
locale === 'ru'
|
|
? import.meta.env.VITE_TELEGRAM_GAME_CHANNEL_NAME_RU
|
|
: import.meta.env.VITE_TELEGRAM_GAME_CHANNEL_NAME_EN;
|
|
const name = (raw as string | undefined)?.trim().replace(/^@/, '');
|
|
return name ? `https://t.me/${name}` : null;
|
|
}
|