This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user