From 7c11cfc5a20e710f6942a97999894ac9ca5d8916 Mon Sep 17 00:00:00 2001 From: Lynn Date: Mon, 24 Jan 2022 17:40:24 +0100 Subject: [PATCH] Try not setting url on shared object at all --- src/Game.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Game.tsx b/src/Game.tsx index 37a6c91..d30457a 100644 --- a/src/Game.tsx +++ b/src/Game.tsx @@ -99,19 +99,19 @@ function Game(props: GameProps) { }; async function share(url: string, copiedHint: string, text?: string) { + const body = url + (text ? "\n\n" + text : ""); if ( /android|iphone|ipad|ipod|webos/i.test(navigator.userAgent) && !/firefox/i.test(navigator.userAgent) ) { try { - await navigator.share({ url, text }); + await navigator.share({ text: body }); return; } catch (e) { console.warn("navigator.share failed:", e); } } try { - const body = url + (text ? "\n\n" + text : ""); await navigator.clipboard.writeText(body); setHint(copiedHint); return;