Share homepage instead of result link
Build and push image / build (push) Successful in 1m17s

This commit is contained in:
alexandrev-tibco
2026-05-05 11:47:03 +02:00
parent dada9bf14a
commit b8f9345015
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ export default function Home() {
() => buildShareUrl(dateKey, progress, typeof window === "undefined" ? "https://hidden11.app" : window.location.origin),
[dateKey, progress],
);
const shareText = useMemo(() => buildShareText(dateKey, progress, t, shareUrl), [dateKey, progress, shareUrl, t]);
const shareText = useMemo(() => buildShareText(dateKey, progress, t), [dateKey, progress, t]);
useEffect(() => {
const savedLocale = window.localStorage.getItem("hidden11-locale") as Locale | null;
+1 -1
View File
@@ -19,7 +19,7 @@ export default function ShareResult({ dateKey, locale, onClose, progress, quote,
const [shared, setShared] = useState(false);
const [origin, setOrigin] = useState("https://hidden11.app");
const shareUrl = useMemo(() => buildShareUrl(dateKey, progress, origin), [dateKey, origin, progress]);
const shareText = useMemo(() => buildShareText(dateKey, progress, t, shareUrl), [dateKey, progress, shareUrl, t]);
const shareText = useMemo(() => buildShareText(dateKey, progress, t), [dateKey, progress, t]);
useEffect(() => {
setOrigin(window.location.origin);
+6 -2
View File
@@ -24,7 +24,7 @@ type SharePayload = {
difficulties: Record<Difficulty, ShareDifficultySummary>;
};
export function buildShareText(dateKey: string, progress: DailyProgress, t: Dictionary, shareUrl?: string): string {
export function buildShareText(dateKey: string, progress: DailyProgress, t: Dictionary): string {
const homeUrl = "https://hidden11.app";
const rows = DIFFICULTIES.map((difficulty) => {
const item = progress[difficulty];
@@ -57,7 +57,11 @@ export function buildShareText(dateKey: string, progress: DailyProgress, t: Dict
].join("\n");
}
export function buildShareUrl(dateKey: string, progress: DailyProgress, origin = "https://hidden11.app"): string {
export function buildShareUrl(_dateKey: string, _progress: DailyProgress, origin = "https://hidden11.app"): string {
return origin.replace(/\/$/, "");
}
export function buildShareResultUrl(dateKey: string, progress: DailyProgress, origin = "https://hidden11.app"): string {
const payload: SharePayload = {
dateKey,
puzzleNumber: getPuzzleNumber(dateKey),