all repos — caroster @ 52ee507b9a4f736cdf8137435e886ca6e9f41b1b

[Octree] Group carpool to your event https://caroster.io

fix: make share button copy to clipboard on desktop (#20)

Sabih S 67878058+kleenkanteen@users.noreply.github.com
Fri, 04 Aug 2023 02:45:49 -0400
commit

52ee507b9a4f736cdf8137435e886ca6e9f41b1b

parent

aff4de6bba49f986a32affe5b25afcf3970efa46

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M frontend/hooks/useShare.tsfrontend/hooks/useShare.ts

@@ -25,8 +25,9 @@ );

const urlCopy = [...splittedUrl] urlCopy[localeParamIndex] = DEFAULT_LOCALE; const withDefaultLocaleURL = urlCopy.join('/'); - // If navigator share capability - if (navigatorHasShareCapability) { + const isPhone = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); + // If navigator share capability and a phone + if (navigatorHasShareCapability && isPhone) { return await navigator.share({ title, url: withDefaultLocaleURL,