Files
sorsfonalak/services/frontend/src/components/ShareVisit.tsx
T
fecoandClaude Opus 5.5 8b8285b5d2
CI / test (push) Successful in 1m41s
CI / build (push) Successful in 5m22s
CI / deploy (push) Skipped
No browser storage for referrals; the birth chart opens at the drawn chart
The share page stores nothing in the browser any more: the shared link
that brought a visitor travels in its login link (/belepes?ref=...) to
the Google, Apple and password sign-up. The backend counts the same
visitor of a link once in half an hour, instead of a sessionStorage flag.

The public birth chart scrolls to the drawn chart after a calculation
and when coming back to the page. Tabs scrolled to themselves on every
re-render of their parent when the address had a tab (#bolygok); they
now react only to the tab ids and hash changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-21 21:13:41 +00:00

18 lines
614 B
TypeScript

"use client";
import { useEffect } from "react";
/**
* Reports a visit of the share page from the visitor's browser. Link preview
* robots do not run scripts, so only people are counted; the backend leaves
* out the sharer and counts the same visitor once in half an hour. Nothing is
* stored in the browser (the sharer who brought a new user travels in the
* login link instead).
*/
export function ShareVisit({ slug }: { slug: string }) {
useEffect(() => {
fetch(`/api/v1/public/shares/${slug}/visit`, { method: "POST", credentials: "same-origin" }).catch(() => {});
}, [slug]);
return null;
}