Skip to content

Commit c096da6

Browse files
authored
Add a navigator.canShare check in ShareButton.importable.tsx
Add a defensive check for navigator.canShare as this is not supported by all browsers
1 parent 500e9f5 commit c096da6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dotcom-rendering/src/components/ShareButton.importable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export const ShareButton = ({
210210
if (
211211
!isLiveBlogBlockDesktop &&
212212
'share' in navigator &&
213+
'canShare' in navigator &&
213214
navigator.canShare(shareData)
214215
) {
215216
setButtonKind('native');

0 commit comments

Comments
 (0)