diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/Result/index.tsx | 5 |
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) |
