From 300234a00d5cd0f983d3256db95e0215b9a4eead Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Thu, 25 Jun 2026 11:35:58 -0700 Subject: [PATCH] Hide Google sign-in on iOS, popup only on desktop/Android --- index.html | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/index.html b/index.html index fbc7a56..b9fd245 100644 --- a/index.html +++ b/index.html @@ -650,8 +650,10 @@ const auth = getAuth(fbApp); const db = getFirestore(fbApp); const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1); -document.getElementById('google-signin-btn').style.display = 'flex'; -document.getElementById('google-divider').style.display = 'flex'; +if (!isIOS) { + document.getElementById('google-signin-btn').style.display = 'flex'; + document.getElementById('google-divider').style.display = 'flex'; +} let currentUser = null; let currentUserData = null; @@ -731,25 +733,8 @@ function getFriendDisplayName(uid) { let _initializingUser = false; // AUTH -if (isIOS) { - getRedirectResult(auth).then(async (result) => { - if (result?.user) { - _initializingUser = true; - await initUser(result.user); - } - }).catch(e => console.warn('Redirect result:', e.code)); -} - onAuthStateChanged(auth, async (user) => { if (_initializingUser) return; - if (isIOS && !user) { - setTimeout(() => { - if (_initializingUser) return; - if (isSignInWithEmailLink(auth, window.location.href)) return; - showScreen('auth'); - }, 1500); - return; - } if (isSignInWithEmailLink(auth, window.location.href)) { const urlParams = new URLSearchParams(window.location.search); @@ -1325,13 +1310,9 @@ window.signInWithGoogle = async function() { btn.innerHTML = ' Signing in…'; try { const provider = new GoogleAuthProvider(); - if (isIOS) { - await signInWithRedirect(auth, provider); - } else { - const result = await signInWithPopup(auth, provider); - _initializingUser = true; - await initUser(result.user); - } + const result = await signInWithPopup(auth, provider); + _initializingUser = true; + await initUser(result.user); } catch(e) { btn.disabled = false; btn.innerHTML = ` Sign in with Google`;