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
18 lines
614 B
TypeScript
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;
|
|
}
|