kopia lustrzana https://github.com/lynn/hello-wordl
Try not setting url on shared object at all
rodzic
672b7143ee
commit
7c11cfc5a2
|
@ -99,19 +99,19 @@ function Game(props: GameProps) {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function share(url: string, copiedHint: string, text?: string) {
|
async function share(url: string, copiedHint: string, text?: string) {
|
||||||
|
const body = url + (text ? "\n\n" + text : "");
|
||||||
if (
|
if (
|
||||||
/android|iphone|ipad|ipod|webos/i.test(navigator.userAgent) &&
|
/android|iphone|ipad|ipod|webos/i.test(navigator.userAgent) &&
|
||||||
!/firefox/i.test(navigator.userAgent)
|
!/firefox/i.test(navigator.userAgent)
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
await navigator.share({ url, text });
|
await navigator.share({ text: body });
|
||||||
return;
|
return;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("navigator.share failed:", e);
|
console.warn("navigator.share failed:", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const body = url + (text ? "\n\n" + text : "");
|
|
||||||
await navigator.clipboard.writeText(body);
|
await navigator.clipboard.writeText(body);
|
||||||
setHint(copiedHint);
|
setHint(copiedHint);
|
||||||
return;
|
return;
|
||||||
|
|
Ładowanie…
Reference in New Issue