Restrict native share dialog to mobile devices, use clipboard copy on desktop
This commit is contained in:
@@ -124,8 +124,10 @@ export default function Game({ dailyPuzzle, genre = null, isSpecial = false, max
|
|||||||
|
|
||||||
const text = `Hördle #${dailyPuzzle.id}\n${genreText}\n${speaker}${emojiGrid}\n\n#Hördle #Music\n\n${shareUrl}`;
|
const text = `Hördle #${dailyPuzzle.id}\n${genreText}\n${speaker}${emojiGrid}\n\n#Hördle #Music\n\n${shareUrl}`;
|
||||||
|
|
||||||
// Try native Web Share API first (mobile-friendly)
|
// Try native Web Share API only on mobile devices
|
||||||
if (navigator.share) {
|
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
||||||
|
|
||||||
|
if (isMobile && navigator.share) {
|
||||||
try {
|
try {
|
||||||
await navigator.share({
|
await navigator.share({
|
||||||
title: `Hördle #${dailyPuzzle.id}`,
|
title: `Hördle #${dailyPuzzle.id}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user