From 45a180ea73d0eebdcaab284c6ed72039164de343 Mon Sep 17 00:00:00 2001 From: Sterling Archer Date: Thu, 18 Jun 2026 20:10:12 -0700 Subject: [PATCH] Add debug logging to handleInviteLink --- index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.html b/index.html index 9573663..31b43e2 100644 --- a/index.html +++ b/index.html @@ -2448,18 +2448,22 @@ async function handleInviteLink() { const inviteToken = _savedInviteToken || localStorage.getItem('pendingInviteToken'); const fromUid = _savedFromUid || localStorage.getItem('pendingInviteFrom'); const inviteEmail = localStorage.getItem('pendingInviteEmail'); + console.log('handleInviteLink:', { inviteToken, fromUid, inviteEmail, currentEmail: currentUser.email }); if (!inviteToken || !fromUid || fromUid === currentUser.uid) { + console.log('handleInviteLink: skipping - no token/fromUid or same user'); localStorage.removeItem('pendingInviteToken'); localStorage.removeItem('pendingInviteFrom'); localStorage.removeItem('pendingInviteEmail'); return; } if (inviteEmail && inviteEmail.toLowerCase() !== currentUser.email.toLowerCase()) { + console.log('handleInviteLink: skipping - email mismatch', inviteEmail, currentUser.email); return; } localStorage.removeItem('pendingInviteToken'); localStorage.removeItem('pendingInviteFrom'); localStorage.removeItem('pendingInviteEmail'); + console.log('handleInviteLink: processing invite', inviteToken, 'from', fromUid); try { const inviteRef = doc(db, 'invites', inviteToken); const inviteSnap = await getDoc(inviteRef);