Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(email): stop double email init on login (#4109)
gbirmand78ab289bef8
diff --git a/js/app/packages/app/component/auth/Login.tsx b/js/app/packages/app/component/auth/Login.tsxindex 0f2e825932..c1a33c5131 100644--- a/js/app/packages/app/component/auth/Login.tsx+++ b/js/app/packages/app/component/auth/Login.tsx@@ -45,17 +45,10 @@ export function Login() {function PostLoginRedirect() {const navigate = useNavigate();- const { initEmailLink } = useEmailLinks();- onMount(async () => {- await initEmailLink().match(- () => {},- (err) => {- if (err.tag !== 'AlreadyInitialized') {- console.error('Failed to init email link on login', err);- }- }- );+ // Login init is owned by the per-method handlers (the session-token effect and+ // onComplete); this redirect only navigates, so login doesn't fire init twice.+ onMount(() => {navigate('/', { replace: true });});diff --git a/js/app/packages/app/component/auth/LoginNew.tsx b/js/app/packages/app/component/auth/LoginNew.tsxindex fd7b043af1..97f93ac2f8 100644--- a/js/app/packages/app/component/auth/LoginNew.tsx+++ b/js/app/packages/app/component/auth/LoginNew.tsx@@ -45,17 +45,10 @@ import { useSsoLogin } from './useSsoLogin';function PostLoginRedirect() {const navigate = useNavigate();- const { initEmailLink } = useEmailLinks();- onMount(async () => {- await initEmailLink().match(- () => {},- (err) => {- if (err.tag !== 'AlreadyInitialized') {- console.error('Failed to init email link on login', err);- }- }- );+ // Login init is owned by the per-method handlers (the session-token effect and+ // onComplete); this redirect only navigates, so login doesn't fire init twice.+ onMount(() => {navigate('/', { replace: true });});