or
@@ -649,6 +649,12 @@ const fbApp = initializeApp(FIREBASE_CONFIG);
const auth = getAuth(fbApp);
const db = getFirestore(fbApp);
+const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
+if (!isIOS) {
+ document.getElementById('google-signin-btn').style.display = 'flex';
+ document.getElementById('google-divider').style.display = 'flex';
+}
+
let currentUser = null;
let currentUserData = null;
let currentProfileData = null;
@@ -725,16 +731,17 @@ function getFriendDisplayName(uid) {
}
// AUTH
-onAuthStateChanged(auth, async (user) => {
- try {
- const redirectResult = await getRedirectResult(auth);
- if (redirectResult?.user) {
- await initUser(redirectResult.user);
- return;
- }
- } catch(e) {
- console.warn('Redirect result error:', e.code);
+let _handlingRedirect = false;
+
+getRedirectResult(auth).then(async (result) => {
+ if (result?.user) {
+ _handlingRedirect = true;
+ await initUser(result.user);
}
+}).catch(e => console.warn('Redirect result error:', e.code));
+
+onAuthStateChanged(auth, async (user) => {
+ if (_handlingRedirect) return;
if (isSignInWithEmailLink(auth, window.location.href)) {
const urlParams = new URLSearchParams(window.location.search);