aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/components/Result/index.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/components/Result/index.tsx b/src/components/Result/index.tsx
index 68636d8..259525b 100644
--- a/src/components/Result/index.tsx
+++ b/src/components/Result/index.tsx
@@ -48,7 +48,10 @@ function ShareButton({
const result = scoreToEmoji(guesses);
const [buttonText, setButtonText] = useState('Share Results');
const handleClick = React.useCallback(() => {
- if (navigator.share !== undefined) {
+ // The Windows share sheet is dumb and doesn't have a copy function.
+ const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'];
+ const onWindows = windowsPlatforms.indexOf(window.navigator.platform) !== -1;
+ if (navigator.share !== undefined && !onWindows) {
navigator.share({text: result})
} else if (navigator.clipboard !== undefined) {
navigator.clipboard.writeText(result)
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage