diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-06-06 00:06:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-05 16:06:33 -0500 |
commit | b523140153c7edbb1931f90351b9a9088c94f771 (patch) | |
tree | 116aad40605e81b59c7dcd598e3de2b3862bd94f /src/components/PostControls/ShareMenu/ShareMenuItems.tsx | |
parent | 1e620b19cca59f04d33cc04f669514b9b16f8290 (diff) | |
download | voidsky-b523140153c7edbb1931f90351b9a9088c94f771.tar.zst |
use method that's actually available on android (#8448)
Diffstat (limited to 'src/components/PostControls/ShareMenu/ShareMenuItems.tsx')
-rw-r--r-- | src/components/PostControls/ShareMenu/ShareMenuItems.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/components/PostControls/ShareMenu/ShareMenuItems.tsx b/src/components/PostControls/ShareMenu/ShareMenuItems.tsx index 94369fcff..c090c3e2d 100644 --- a/src/components/PostControls/ShareMenu/ShareMenuItems.tsx +++ b/src/components/PostControls/ShareMenu/ShareMenuItems.tsx @@ -10,6 +10,7 @@ import {type NavigationProp} from '#/lib/routes/types' import {shareText, shareUrl} from '#/lib/sharing' import {toShareUrl} from '#/lib/strings/url-helpers' import {logger} from '#/logger' +import {isIOS} from '#/platform/detection' import {useProfileShadow} from '#/state/cache/profile-shadow' import {useSession} from '#/state/session' import * as Toast from '#/view/com/util/Toast' @@ -61,12 +62,16 @@ let ShareMenuItems = ({ onShareProp() } - const onCopyLink = () => { + const onCopyLink = async () => { logger.metric('share:press:copyLink', {}, {statsig: true}) const url = toShareUrl(href) - ExpoClipboard.setUrlAsync(url).then(() => - Toast.show(_(msg`Copied to clipboard`), 'clipboard-check'), - ) + if (isIOS) { + // iOS only + await ExpoClipboard.setUrlAsync(url) + } else { + await ExpoClipboard.setStringAsync(url) + } + Toast.show(_(msg`Copied to clipboard`), 'clipboard-check') onShareProp() } |