mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
fix: remove unreliable Telegram environment detection to fix loading delay
Remove unreliable conditions from Telegram environment detection in useAuthSource: - window.Telegram !== undefined: Always true due to unconditional SDK loading - window.self !== window.top: Causes false positives in iframe scenarios Only keep URL parameter detection (tgWebApp in search/hash) which is reliable. This prevents 5-second polling delay before login page displays on PC browser.
This commit is contained in:
@@ -78,11 +78,9 @@ export function useAuthSource(): {
|
||||
}
|
||||
|
||||
// Check if we're likely in a Telegram environment before polling
|
||||
// Hints: Telegram object exists (SDK loading), iframe, or Telegram URL params (in query or hash)
|
||||
// Only use URL params (tgWebApp) as reliable indicator
|
||||
const hasTelegramHint =
|
||||
typeof window !== 'undefined' && (
|
||||
window.Telegram !== undefined ||
|
||||
window.self !== window.top ||
|
||||
window.location.search.includes('tgWebApp') ||
|
||||
window.location.hash.includes('tgWebApp')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user