mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
Add lazy loading of Telegram SDK only when running inside Telegram Mini App environment instead of unconditionally loading in all browsers. Includes: - New environment detection functions: isTelegramEnvironment(), isTelegramApp() - Dynamic SDK loading with 3s timeout via loadTelegramSdk() - Removed static script tag from index.html - Made haptic feedback lazy (SDK check on each call) - Made theme listeners lazy (attached in initializeTheme()) - Updated all components to use unified detection functions This prevents SDK load time overhead in regular browser environments while ensuring the app works correctly both in Telegram and browser contexts.